Skip to content

fix(cli): handle top-level version flag - #20

Open
vsolano9 wants to merge 1 commit into
AgentPostmortem:mainfrom
vsolano9:fix-4-version-flag
Open

fix(cli): handle top-level version flag#20
vsolano9 wants to merge 1 commit into
AgentPostmortem:mainfrom
vsolano9:fix-4-version-flag

Conversation

@vsolano9

Copy link
Copy Markdown

What & why

Handle --version before the missing-command usage branch so a conventional top-level version probe prints the CLI version and exits successfully. This keeps install and CI version probes from being treated as usage errors.

Closes #4

Changes

  • prioritize --version before bare-invocation usage handling
  • assert --version prints only a semantic version and returns 0
  • pin neighboring bare invocation (exit 2) and explicit help (exit 0) behavior

Validation

  • npm test — 7 files, 53 tests passed
  • npm run lint
  • npm run typecheck
  • npm run build
  • focused CLI test repeated 20 times
  • full tests and TypeScript build under Node 20.20.2 and Node 22.23.2
  • git diff --check

Checklist

  • focused change with regression coverage
  • documented repository checks pass
  • no dependency or configuration changes
  • linked issue with Closes #4

Handle --version before the missing-command usage branch so a conventional top-level version probe succeeds. Add regression coverage for version, bare invocation, and explicit help behavior.
@github-actions

Copy link
Copy Markdown

Welcome, @vsolano9, and thanks for your first pull request to MCP-audit.

A quick look at CONTRIBUTING.md covers how things are set up and run here.

I'll review this shortly. Ask anything in the thread if something is unclear.

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.

Bug: mcp-audit --version prints usage and exits 2

1 participant