myxce/src/frontend/xcecli
Rongsong Shen fb09afe6be
feat(build-time-versioning): xcecli --version via Cobra rootCmd.Version
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>
2026-08-20 14:07:38 +00:00
..
cmd feat(build-time-versioning): xcecli --version via Cobra rootCmd.Version 2026-08-20 14:07:38 +00:00
common fix(xcecli): restore dangling CA-cert cleanup misses, enable https support 2026-07-23 07:28:01 +00:00
config fix(scheduler,cli): bug-1453/1454/1455/1456 remove dead CA-cert plumbing, fix scheduler HA config bugs 2026-07-20 12:01:10 +00:00
filters improve frontend jobid display 2026-05-07 02:36:24 +00:00
models merge 2026-07-23 12:35:10 +08:00
router feat(build-time-versioning): xcecli --version via Cobra rootCmd.Version 2026-08-20 14:07:38 +00:00
test Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
go.mod Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
go.sum Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
meson.build feat(build-time-versioning): thread commit_id/build_time into go_build env 2026-08-20 12:50:36 +00:00