Skip to content

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

Closed
adity982 wants to merge 1 commit into
AgentPostmortem:mainfrom
adity982:fix/4-top-level-version
Closed

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

Conversation

@adity982

Copy link
Copy Markdown

What & why

Handle --version before the missing-command usage branch so a conventional top-level version probe prints the version and exits successfully. This fixes install scripts and CI probes that currently abort on exit code 2.

Closes #4

Changes

  • Move the version flag handling ahead of the bare-invocation help branch.
  • Add regression coverage for top-level --version output and exit status.
  • Pin the neighboring bare invocation (exit 2) and explicit help (exit 0) behavior.

Validation

npm test
PASS — 7 files, 53 tests

npm run typecheck
PASS

npm run build
PASS

git diff --check
PASS

Checklist

  • Focused change with a clear description
  • Ran lint/typecheck, build, and tests
  • No documentation change is needed; --version is already documented
  • Linked related issue with Closes #4

Signed-off-by: Aditya Datta <crazyme07071996@gmail.com>
@github-actions

Copy link
Copy Markdown

Welcome, @adity982, 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

2 participants