Skip to content

feat: add --version flag#53

Merged
devploit merged 1 commit intodevploit:mainfrom
clarabennettdev:add-version-flag
Mar 7, 2026
Merged

feat: add --version flag#53
devploit merged 1 commit intodevploit:mainfrom
clarabennettdev:add-version-flag

Conversation

@clarabennettdev
Copy link
Contributor

Summary

Adds --version flag support as requested in #52.

Changes

  • Added Version and BuildDate variables in main.go (injected via ldflags at build time, already configured in .goreleaser.yaml)
  • Added SetVersionInfo() function in cmd/root.go that sets rootCmd.Version with a custom template
  • Default values (dev / unknown) for local development builds

Usage

$ nomore403 --version
nomore403 version 1.2.3 (built 2026-02-15)

$ nomore403 -v  # note: -v is already used for --verbose, so only --version works

No changes to existing flags or behavior.

Closes #52

Add --version flag support using cobra's built-in version functionality.
Version and build date are injected via ldflags at build time (already
configured in .goreleaser.yaml), with sensible defaults for dev builds.

Closes devploit#52
@devploit devploit merged commit a43243f into devploit:main Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add --version flag

2 participants