aboutsummaryrefslogtreecommitdiff
path: root/src/cli/workspace.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/workspace.rs')
-rw-r--r--src/cli/workspace.rs21
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]");
}