-
Notifications
You must be signed in to change notification settings - Fork 9
Add version command #230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add version command #230
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prepend sbctl to the version string. Something like below
sbctl version v0.17.1-33-gadd33d0
go version go1.24.2
Somehow I got back to this to review before I saw Evan's comment. I agree adding the Go version would also be helpful
Please ignore all the noise above. Wish I could hide my stale review reason. Anyway, moving along here…
@banjoh thinking about it slightly more… at risk of bikeshedding, I like the output as-is:
I think it's clear the first line is the command version, and go version already has go prepended. |
@banjoh @scottrigby I don't have any objections to either, for reference the replicated CLI looks like this:
|
@banjoh ready for re-review:
|
Summary
Test plan
go fmt ./pkg/... ./cli/... ./tests/...
go vet -tags "netgo containers_image_ostree_stub exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_openpgp" -installsuffix netgo ./pkg/... ./cli/... ./tests/...
go build -o bin/sbctl -ldflags "-X github.com/replicatedhq/sbctl/cli.Version=v0.17.1-33-gadd33d0" sbctl.go
go1.24.2 to verify it displays both the sbctl version and Go compiler version