Skip to content

Add version flags to the CodePact CLI - #23

Closed
jamesyshd19-cmyk wants to merge 1 commit into
codepacct:mainfrom
jamesyshd19-cmyk:feat/cli-version
Closed

jamesyshd19-cmyk wants to merge 1 commit into
codepacct:mainfrom
jamesyshd19-cmyk:feat/cli-version

Conversation

@jamesyshd19-cmyk

Copy link
Copy Markdown

What

Add --version and -v to print the version from package.json and exit successfully without a scan path. List both aliases in CLI help.

Why

Users can include the CodePact version when reporting differences between runs.

Scope

CLI option handling, help, and subprocess tests for both aliases. Scan behavior and report formats stay as they are.

Verification

  • npm test passed all 35 tests on macOS arm64 with Node 26.13.1. The suite ran from a byte-identical checkout path without spaces because an existing analyzer test mishandles those paths.
  • npm run check:clean exited 0. npm run check:broken exited 1 as expected.
  • Both aliases printed the package version followed by one newline, exited 0, and produced empty stderr.

Closes #20

@eleven-smg

Copy link
Copy Markdown
Contributor

Superseded by #24, which adds the same --version and -v flags plus the rest of the CLI hardening and tests. Thank you for the clean implementation and verification notes, James. Closing this one to avoid a conflicting duplicate, with credit to you for the original change.

@eleven-smg eleven-smg closed this Nov 27, 2026
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.

Add a --version flag to the CLI

2 participants