specverb-gen: generated binaries should report a --version #148

Closed
opened 2026-06-17 18:58:22 +00:00 by coilysiren · 0 comments
Owner

What

Generated specverb-gen consumer binaries (ward-kdl and friends) expose no --version. The merged main.go builds a cli.Command with no Version field, so there is no way to ask a built binary which release it is.

Why

ward is brewed and its status-line treatment compares the installed binary's --version against the repo's latest tag to flag staleness. ward-kdl is built by this driver and should get the same treatment, which requires the binary to report a version.

Change

  • Generated main.go now carries var Version = "dev" wired to the root command's Version, so urfave/cli auto-registers --version.
  • specverb-gen build --set-version <v> injects the release tag via -ldflags "-X main.Version=".
  • The stamped version joins the cache staleness inputs so a version change forces a rebuild.

Downstream: ward's formula passes its release tag as --set-version when building ward-kdl.

## What Generated specverb-gen consumer binaries (`ward-kdl` and friends) expose no `--version`. The merged `main.go` builds a `cli.Command` with no `Version` field, so there is no way to ask a built binary which release it is. ## Why ward is brewed and its status-line treatment compares the installed binary's `--version` against the repo's latest tag to flag staleness. ward-kdl is built by this driver and should get the same treatment, which requires the binary to report a version. ## Change - Generated `main.go` now carries `var Version = "dev"` wired to the root command's `Version`, so urfave/cli auto-registers `--version`. - `specverb-gen build --set-version <v>` injects the release tag via `-ldflags "-X main.Version="`. - The stamped version joins the cache staleness inputs so a version change forces a rebuild. Downstream: ward's formula passes its release tag as `--set-version` when building ward-kdl.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coilyco-flight-deck/cli-guard#148
No description provided.