Skip to content

fix(setup): support -h/--help instead of running installer (#1133)#1219

Open
saen-ai wants to merge 1 commit intogarrytan:mainfrom
saen-ai:fix/setup-help-1133
Open

fix(setup): support -h/--help instead of running installer (#1133)#1219
saen-ai wants to merge 1 commit intogarrytan:mainfrom
saen-ai:fix/setup-help-1133

Conversation

@saen-ai
Copy link
Copy Markdown

@saen-ai saen-ai commented Apr 26, 2026

Fixes #1133.

Before

./setup --help silently ran the full installer because the arg parser's catch-all (*) shift) swallowed unknown flags. Reported by @dgrant — instinct was to check syntax with --help, got an install instead.

After

-h / --help print a usage banner and exit 0. The check runs before the bun availability guard so the flag is discoverable on a fresh machine that hasn't installed bun yet.

$ ./setup --help
gstack setup — install gstack skills + build browse binary

Usage: ./setup [options]

Options:
  --host <name>     Install for a specific host (claude, codex, kiro, factory,
                    opencode, openclaw, hermes, gbrain, auto). Default: claude.
  --prefix          Install skills with the gstack- prefix (e.g. /gstack-review).
  --no-prefix       Install skills with short names (e.g. /review). Default.
  --team            Switch to team mode (per-repo gstack with auto-update).
  --no-team         Force solo install even if a team-mode repo is detected.
  -q, --quiet       Suppress progress output.
  -h, --help        Show this help and exit.
...

Tests

test/setup-help.test.ts adds 5 cases following the static-pattern convention from test/setup-codesign.test.ts:

  • usage function exists
  • -h|--help is handled before the bun availability check
  • usage text covers every documented flag
  • ./setup --help exits 0, prints Usage:, runs no installer side effects
  • ./setup -h is equivalent to ./setup --help

bun test test/setup-help.test.ts → 5 pass. Existing setup-codesign tests unaffected.

Scope notes

  • Did not touch the catch-all *) shift ;; (silently swallows other unknown flags) — that's a separate behaviour worth its own discussion.
  • No template/generated drift: the change is in setup only, no .tmpl regen needed.

…1133)

Before: `./setup --help` silently ran the full installer because the arg
parser's catch-all (`*) shift`) swallowed unknown flags.

After: `-h`/`--help` print a usage banner and exit 0. The check runs
before the bun availability guard so the flag is discoverable on a fresh
machine.

Tests: test/setup-help.test.ts covers the usage function, ordering vs the
bun check, flag coverage, and live invocation of both `./setup --help`
and `./setup -h`. Existing setup-codesign tests unaffected.

Fixes garrytan#1133
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

./setup --help is not supported — runs install instead

1 participant