fix(cli): support lowercase version flag - #289
Closed
Junior (seilorjunior) wants to merge 1 commit into
Closed
Junior (seilorjunior) wants to merge 1 commit into
Junior (seilorjunior) wants to merge 1 commit into
Conversation
Register -v using Commander's version handler while preserving -V and --version. Cover all three forms through the actual CLI entry point. Closes Azure#224 Co-authored-by: GitHub Copilot <noreply@github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The -v alias is not currently registered, so the requested behavior remains broken.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds lowercase -v CLI version support while retaining -V and --version, with entry-point test coverage.
Changes:
- Updates CLI version-option registration.
- Tests all three version flags and output behavior.
File summaries
| File | Summary |
|---|---|
tests/unit/cli/index.test.ts |
Covers -v, -V, and --version. |
src/cli/index.ts |
Configures CLI version flags; -v still requires explicit registration. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite (auto)
Note
Copilot is running an experiment and ran this review at Lite.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+23
to
24
| .version(packageJson.version, '-v') | ||
| .version(packageJson.version) |
Alexander Zaslonov (azaslonov)
approved these changes
Sep 25, 2026
Member
|
Thank you for this fix, Junior (@seilorjunior)! The same change for #224 (adding -v alongside -V and --version) has already landed on main via #298, so I'm closing this PR as superseded. Sorry for the overlap, and we appreciate the contribution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Register -v using Commander's version handler while preserving -V and --version. Cover all three forms through the actual CLI entry point.
Closes #224
This pull request enhances the CLI tool's version flag support and updates the related tests to ensure correct behavior. The main focus is to support both short and long version flags for user convenience.
CLI usability improvements
-vshort flag (in addition to the existing--versionand-Vflags) to display the CLI version insrc/cli/index.ts.Testing improvements
index.test.tsto verify that all version flags (-v,-V, and--version) correctly output the version, and that no errors are printed to stderr.