Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-setup-help-flag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@googleworkspace/cli": patch
---

Handle --help/-h in `gws auth setup` before launching the setup wizard, preventing accidental project creation when users just want usage info
12 changes: 12 additions & 0 deletions src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1599,6 +1599,18 @@ fn prompt_login_after_setup() -> Result<bool, GwsError> {

/// Run the full setup flow. Orchestrates all steps and outputs JSON summary.
pub async fn run_setup(args: &[String]) -> Result<(), GwsError> {
// Handle --help / -h before any setup work (which requires gcloud).
if args.iter().any(|a| a == "--help" || a == "-h") {
println!(
"Usage: gws auth setup [options]\n\n\
Options:\n \
--project <id> Use a specific GCP project\n \
--login Run `gws auth login` after successful setup\n \
--dry-run Preview changes without making them"
);
return Ok(());
}

let opts = parse_setup_args(args);
let dry_run = opts.dry_run;
let interactive = std::io::IsTerminal::is_terminal(&std::io::stdin()) && !dry_run;
Expand Down
Loading