Fix CLI stripping --interactive and similar snapshot flags (#9)
* Fix --interactive flag being stripped for snapshot command The clean_args function was removing all --prefixed arguments, which incorrectly stripped command-specific flags like --interactive, --compact, --depth, and --selector. Changed to only strip known global flags. * Update Cargo.lock --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
70816dc594
commit
5e94a18496
+7
-2
@@ -41,6 +41,9 @@ pub fn clean_args(args: &[String]) -> Vec<String> {
|
|||||||
let mut result = Vec::new();
|
let mut result = Vec::new();
|
||||||
let mut skip_next = false;
|
let mut skip_next = false;
|
||||||
|
|
||||||
|
// Global flags that should be stripped from command args
|
||||||
|
const GLOBAL_FLAGS: &[&str] = &["--json", "--full", "--headed", "--debug"];
|
||||||
|
|
||||||
for arg in args.iter() {
|
for arg in args.iter() {
|
||||||
if skip_next {
|
if skip_next {
|
||||||
skip_next = false;
|
skip_next = false;
|
||||||
@@ -50,9 +53,11 @@ pub fn clean_args(args: &[String]) -> Vec<String> {
|
|||||||
skip_next = true;
|
skip_next = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if !arg.starts_with("--") && arg != "-f" {
|
// Only strip known global flags, not command-specific flags
|
||||||
result.push(arg.clone());
|
if GLOBAL_FLAGS.contains(&arg.as_str()) || arg == "-f" {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
result.push(arg.clone());
|
||||||
}
|
}
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user