Skip to content

feat: add --version flag#53

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

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

Conversation

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