diff options
Diffstat (limited to 'src/cli/spec.rs')
| -rw-r--r-- | src/cli/spec.rs | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/cli/spec.rs b/src/cli/spec.rs index 1f2e85a4..3be83328 100644 --- a/src/cli/spec.rs +++ b/src/cli/spec.rs @@ -229,8 +229,7 @@ fn worktree_command() -> Command { Command::new("list") .about("List worktree workspaces") .arg(option("workspace", "ID")) - .arg(path_option("cwd", "PATH")) - .arg(json_flag()), + .arg(path_option("cwd", "PATH")), ) .subcommand( Command::new("create") @@ -242,8 +241,7 @@ fn worktree_command() -> Command { .arg(path_option("path", "PATH")) .arg(option("label", "TEXT")) .arg(flag("focus")) - .arg(flag("no-focus")) - .arg(json_flag()), + .arg(flag("no-focus")), ) .subcommand( Command::new("open") @@ -254,15 +252,13 @@ fn worktree_command() -> Command { .arg(option("branch", "NAME")) .arg(option("label", "TEXT")) .arg(flag("focus")) - .arg(flag("no-focus")) - .arg(json_flag()), + .arg(flag("no-focus")), ) .subcommand( Command::new("remove") .about("Remove a worktree checkout") .arg(option("workspace", "ID")) - .arg(flag("force")) - .arg(json_flag()), + .arg(flag("force")), ) } @@ -1192,6 +1188,18 @@ mod tests { } #[test] + fn worktree_json_compatibility_flag_stays_out_of_public_spec() { + let cmd = super::command(); + for subcommand in ["list", "create", "open", "remove"] { + let worktree_command = command_path(&cmd, &["worktree", subcommand]); + assert!( + !has_option(worktree_command, "json"), + "herdr worktree {subcommand} should not advertise --json" + ); + } + } + + #[test] fn spec_includes_nested_plugin_pane_open_options() { let cmd = super::command(); let open = command_path(&cmd, &["plugin", "pane", "open"]); |
