Skip to content

b --version=false prints the version banner #181

Description

@fentas

Split out of the round-2 review of #180 (both findings pre-date that PR).

  1. 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".

  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions