feat: add CLI version flag - #15
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a CLI --version/-V flag that prints the bifrost CLI version and build commit, updates the README to document it (and adjusts Markdown formatting), and adds unit tests to validate the version output and exit code.
Changes:
- Add
--versionand-Vflags to print version/commit and exit successfully. - Add unit tests for both version flag variants.
- Update README options table and adjust Markdown code fencing.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| README.md | Documents the new --version/-V flag and adjusts Markdown fencing in the usage section. |
| internal/bifrost/cli.go | Implements --version/-V handling and adds a printVersion helper. |
| internal/bifrost/cli_test.go | Adds coverage for version output via a new stdout capture helper and tests both flag variants. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+21
to
+23
| showVersion := false | ||
| fl.BoolVar(&showVersion, "version", false, "show version and commit, then exit") | ||
| fl.BoolVar(&showVersion, "V", false, "show version and commit, then exit") |
Contributor
Author
There was a problem hiding this comment.
We should use the AliasedFlagSet from #16
# Conflicts: # README.md # internal/bifrost/cli.go # internal/bifrost/cli_test.go
# Conflicts: # README.md
alexanderbsingh
marked this pull request as ready for review
August 10, 2026 13:04
konrader
approved these changes
Aug 10, 2026
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.
Add
--versionand-Vflags to print the CLI version and build commit.The version flag should utilize the
AliasedFlagSetintroduced in #16