Skip to content

Comments

feat: add --version flag#53

Open
clarabennettdev wants to merge 1 commit intodevploit:mainfrom
clarabennettdev:add-version-flag
Open

feat: add --version flag#53
clarabennettdev wants to merge 1 commit intodevploit:mainfrom
clarabennettdev:add-version-flag

Conversation

@clarabennettdev
Copy link

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
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

1 participant