Skip to content

Add --version flag#163

Open
piersdd wants to merge 1 commit intotailscale:mainfrom
piersdd:feat/version-flag
Open

Add --version flag#163
piersdd wants to merge 1 commit intotailscale:mainfrom
piersdd:feat/version-flag

Conversation

@piersdd
Copy link
Copy Markdown

@piersdd piersdd commented Apr 2, 2026

Adds a version variable set at build time via ldflags and a --version flag that prints it and exits.

  • var version = "dev" default, overridden by -X main.version=...
  • Checked before flag.Parse() so it doesn't conflict with the flag package
  • Makefile passes -X main.version=$(VERSION) using git describe

Adds a `version` variable set at build time via ldflags and a
`--version` flag that prints it and exits. Checked before flag.Parse()
so it doesn't conflict with the flag package.

Makefile updated to pass `-X main.version=$(VERSION)` using git describe.
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.

1 participant