Skip to content

fix: return zero for top-level help flag - #147

Open
wowsofine wants to merge 1 commit into
focus-mcp:developfrom
wowsofine:codex/help-flag-exit-zero
Open

fix: return zero for top-level help flag#147
wowsofine wants to merge 1 commit into
focus-mcp:developfrom
wowsofine:codex/help-flag-exit-zero

Conversation

@wowsofine

Copy link
Copy Markdown

Summary

  • Make the explicit top-level focus --help flag exit with code 0.
  • Preserve the existing no-argument behavior, which still prints help and exits 1.
  • Add a focused binary-level regression test for --help.

Why

The published CLI prints the top-level help text for focus --help, but exits with status 1 because the command is absent. Explicit help flags should be successful metadata commands for shell scripts, package smoke checks, and CLI conventions.

Verification

  • npx --yes pnpm@10.32.1 vitest run --config config/vitest.config.ts src/bin/focus.test.ts
  • npx --yes pnpm@10.32.1 lint
  • npx --yes pnpm@10.32.1 typecheck
  • npx --yes pnpm@10.32.1 build
  • npx --yes pnpm@10.32.1 test
  • FOCUS_NO_UPDATE_NOTIFY=1 CLI_VERSION=2.4.0 CORE_VERSION=1.6.0 node dist/bin/focus.js --help
  • FOCUS_NO_UPDATE_NOTIFY=1 CLI_VERSION=2.4.0 CORE_VERSION=1.6.0 node dist/bin/focus.js --version
  • git diff --check

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