Split out of the round-2 review of #180 (both findings pre-date that PR).
-
b --version=false prints the banner and exits 0. wantsVersionBanner (pkg/cli/root.go) gates on pflag's Changed, which is true for any explicit assignment, and never looks at the value. Fix: also require f.Value.String() == "true".
-
The same predicate is fail-quiet: it returns false when the flag lookup misses, so renaming the version persistent flag registration would silently kill b --version rather than erroring. Worth an explicit guard or a startup assertion.
Neither is a regression from #180 — the old cmd.Flags().Changed("version") had identical semantics.
Split out of the round-2 review of #180 (both findings pre-date that PR).
b --version=falseprints the banner and exits 0.wantsVersionBanner(pkg/cli/root.go) gates on pflag'sChanged, which is true for any explicit assignment, and never looks at the value. Fix: also requiref.Value.String() == "true".The same predicate is fail-quiet: it returns false when the flag lookup misses, so renaming the
versionpersistent flag registration would silently killb --versionrather than erroring. Worth an explicit guard or a startup assertion.Neither is a regression from #180 — the old
cmd.Flags().Changed("version")had identical semantics.