feat(cli): add --version flag#137
Conversation
📝 WalkthroughWalkthroughA ChangesCLI Version Propagation
Sequence Diagram(s)sequenceDiagram
participant main as main.go
participant cli as cli.SetupCLI
participant cmd as ace Command
main->>main: define version = "2.1.0"
main->>cli: SetupCLI(version)
cli->>cmd: set Version field
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/cli/cli.go`:
- Around line 435-438: The CLI uses the shared -v alias in app setup and in
commonFlags/start/server, which conflicts with the built-in version flag
behavior. Update the cli.Command configuration in ace so only one meaning owns
-v: either remove/rename the debug alias in commonFlags and the related
subcommand flags, or explicitly override the default version flag handling. Make
sure the conflict is resolved consistently across the cli.Command definition and
the flag definitions used by start and server.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7a8172e1-eb8f-4c8e-882c-bd194d4d99b7
📒 Files selected for processing (2)
cmd/ace/main.gointernal/cli/cli.go
Leverage urfave/cli/v3's built-in Version support by setting the root command's Version field. Default is 2.1.0, overridden at release time via the existing goreleaser -X main.version ldflag. Use -V (not the default -v) as the short alias so -v stays reserved for the debug/verbose flag on subcommands.
ec94740 to
04a20ba
Compare
Leverage urfave/cli/v3's built-in Version support by setting the root command's Version field. Default is 2.1.0, overridden at release time via the existing goreleaser -X main.version ldflag.
We support --version or -V for version.
Note that -v (lower case) is a convention for debug mode. It works with subcommands, but not the top level "ace -v" alone.