Skip to content

Fix top-level CLI help and version flags - #1

Open
120850853 wants to merge 1 commit into
liuneng1994:mainfrom
120850853:fix-help-flag
Open

Fix top-level CLI help and version flags#1
120850853 wants to merge 1 commit into
liuneng1994:mainfrom
120850853:fix-help-flag

Conversation

@120850853

Copy link
Copy Markdown

Summary

  • handle top-level --help / -h before defaulting to the start command
  • add top-level --version / -V support using the existing version command
  • add a focused smoke script for installed CLI flag behavior

Reproduction

From a clean install of copilot-deck@0.1.5:

npm install --ignore-scripts --no-audit --no-fund copilot-deck@0.1.5
./node_modules/.bin/copilot-deck --help

Actual behavior before this change:

TypeError [ERR_PARSE_ARGS_UNKNOWN_OPTION]: Unknown option '--help'

Root cause: the dispatcher defaults any first argument that starts with - to start, so --help is parsed by the strict start-option parser instead of printing the documented top-level help.

Verification

pnpm install --ignore-scripts --frozen-lockfile
pnpm --filter copilot-deck exec tsc
pnpm smoke:cli-flags
pnpm lint
pnpm build
pnpm --filter copilot-deck pack --pack-destination /tmp/earn-micro-scan

Packed tarball smoke:

npm install --ignore-scripts --no-audit --no-fund /tmp/earn-micro-scan/copilot-deck-0.1.5.tgz
./node_modules/.bin/copilot-deck --help
./node_modules/.bin/copilot-deck --version

Both packed CLI commands exit 0, print to stdout, and leave stderr empty.

Duplicate check

I checked open issues and PRs before submitting:

gh issue list --repo liuneng1994/copilot-deck --state open --limit 30
gh pr list --repo liuneng1994/copilot-deck --state open --limit 30

Both were empty at the time of submission.

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.

1 participant