feat(cli): always print version header first, add --no-version flag

Previously the version banner only printed via PersistentPreRun, which
Cobra skips for --help and bare invocations. It now prints from main()
before Cobra parses anything, so it's the first line for every command.
Suppressible with --no-version; skipped for the version subcommand to
avoid duplicating its own output.
This commit is contained in:
Hein
2026-08-24 12:59:14 +02:00
parent 92d5df9a64
commit 241bfc2302
2 changed files with 20 additions and 3 deletions
+1
View File
@@ -6,6 +6,7 @@ import (
)
func main() {
printVersionHeader(os.Args[1:])
if err := rootCmd.Execute(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)