diff options
| author | akbash <akbash@herdr.dev> | 2026-08-25 23:44:56 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-25 23:44:56 +0300 |
| commit | d79fd746a96ddb5642939c9727baefce642d78e6 (patch) | |
| tree | f6ca7416b082168db6607952d5fb6672f5173826 /src/cli/workspace.rs | |
| parent | da5357d23f8450d4609f72d079876d7d439ef5a0 (diff) | |
fix: require explicit workspace group close (#3206)
refs #2874
Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>
Diffstat (limited to 'src/cli/workspace.rs')
| -rw-r--r-- | src/cli/workspace.rs | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/cli/workspace.rs b/src/cli/workspace.rs index 525fc971..c24c9b73 100644 --- a/src/cli/workspace.rs +++ b/src/cli/workspace.rs @@ -225,16 +225,19 @@ fn workspace_report_metadata(args: &[String]) -> std::io::Result<i32> { } fn workspace_close(args: &[String]) -> std::io::Result<i32> { - let Some(raw_workspace_id) = args.first() else { - eprintln!("usage: herdr workspace close <workspace_id>"); - return Ok(2); + let (raw_workspace_id, close_group) = match args { + [workspace_id] => (workspace_id, false), + [workspace_id, flag] if flag == "--group" => (workspace_id, true), + _ => { + eprintln!("usage: herdr workspace close <workspace_id> [--group]"); + return Ok(2); + } }; - if args.len() != 1 { - eprintln!("usage: herdr workspace close <workspace_id>"); - return Ok(2); - } - super::runtime::workspace_close(super::normalize_workspace_id(raw_workspace_id)) + super::runtime::workspace_close(crate::api::schema::WorkspaceCloseParams { + workspace_id: super::normalize_workspace_id(raw_workspace_id), + close_group, + }) } fn print_workspace_help() { @@ -245,5 +248,5 @@ fn print_workspace_help() { eprintln!(" herdr workspace focus <workspace_id>"); eprintln!(" herdr workspace rename <workspace_id> <label>"); eprintln!(" herdr workspace report-metadata <workspace_id> --source ID [--token NAME=VALUE] [--clear-token NAME] [--seq N] [--ttl-ms N]"); - eprintln!(" herdr workspace close <workspace_id>"); + eprintln!(" herdr workspace close <workspace_id> [--group]"); } |
