Skip to content

feature/wgcf/version-command - #636

Open
michaelik1 wants to merge 3 commits into
ViRb3:masterfrom
michaelik1:feature/wgcf/version-command
Open

michaelik1 wants to merge 3 commits into
ViRb3:masterfrom
michaelik1:feature/wgcf/version-command

Conversation

@michaelik1

Copy link
Copy Markdown
Contributor

Motivation

Resolves #193.

Users running wgcf in automated environments need a reliable way to retrieve the current version for use in scripts, update checks, and other tools.

Description

Adds a --version flag that prints only the current version string (e.g. v2.3.1), matching the GitHub release tag format.

Usage:

wgcf --version

For local development builds, the version defaults to dev. A custom version can also be injected at build time using linker flags:

go build -ldflags "-X github.com/ViRb3/wgcf/v2/cmd.version=v2.3.1" .
./wgcf --version # v2.3.1

GoReleaser is also configured to automatically inject the release version during builds, so each release binary reports its own version without requiring manual updates to the source code.

Added tests to verify the exact --version output and build-time version injection.


@ViRb3

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.

Enhancement: add "version" command

1 participant