Adds GitCommit/BuildTime vars to xcecli's main.go. Cobra's rootCmd is declared unexported in router.go (a different file than the task's original main.go-only boundary), so main.go can't reach it directly -- resolved by extending router.go's sole exported entry point, Execute(cm, version), to accept the composed version string and set rootCmd.Version before rootCmd.Execute() runs. Cobra then auto-registers --version/-v natively once rootCmd.Version is non-empty (confirmed via reading Cobra v1.9.1 source directly) -- zero additional flag-parsing code, as designed. Live-verified via both build paths (meson xce-build.sh and make build-cli): real commit id (matching git rev-parse --short HEAD plus dirty suffix) and build time, exit 0. xcecli's startup log deliberately not extended -- Requirement 3 scopes that to the four daemons only; xcecli is a one-shot CLI. Corrects a stale design.md line that had assumed otherwise. Task 4.5/13 -- closes out the Go binary version display phase (tasks 4.1-4.5). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| settings | ||
| specs | ||
| steering | ||