Skip to content

feat: support --version flag to print built version#7

Merged
outofcoffee merged 1 commit into
mainfrom
feat/version-flag
Jun 21, 2026
Merged

feat: support --version flag to print built version#7
outofcoffee merged 1 commit into
mainfrom
feat/version-flag

Conversation

@outofcoffee

Copy link
Copy Markdown
Collaborator

Add support for since --version and since -v to print the built version of the binary.

Summary

  • Added a Version variable in cmd/root.go that defaults to dev for development builds
  • Wired it into Cobra's built-in --version / -v flag support
  • Updated .goreleaser.yml to inject the release version via ldflags -X during release builds
  • Updated Dockerfile to accept version as a build arg and inject it
  • Updated Makefile to support VERSION override at build time

Add a Version variable in cmd/root.go that defaults to 'dev' and can be
overridden at build time via ldflags -X. Wire it into Cobra's built-in
--version flag, and inject the version in .goreleaser.yml and Dockerfile
so released binaries include the correct version.
@outofcoffee outofcoffee added the enhancement New feature or request label Jun 21, 2026
@outofcoffee outofcoffee marked this pull request as ready for review June 21, 2026 13:37
@outofcoffee outofcoffee merged commit 6b9e3e5 into main Jun 21, 2026
1 check passed
@outofcoffee outofcoffee deleted the feat/version-flag branch June 21, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant