version: make --version print the same line as the version commandUnverified
Fixes #6 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FgkcT3UPxwxukBKojB5eg4
3daaa75 parent: f4dae4e modified
cmd/version.go +2 -0 | @@ -18,4 +18,6 @@ func init() { | ||
| 18 | 18 | } |
| 19 | 19 | rootCmd.AddCommand(versionCmd) |
| 20 | 20 | rootCmd.Version = Version |
| 21 | + // `rickub --version` prints the same line as `rickub version`. | |
| 22 | + rootCmd.SetVersionTemplate(fmt.Sprintf("rickub {{.Version}} (%s/%s)\n", runtime.GOOS, runtime.GOARCH)) | |
| 21 | 23 | } |
| @@ -18,4 +18,6 @@ func init() { | |||
| 18 | } | 18 | } |
| 19 | rootCmd.AddCommand(versionCmd) | 19 | rootCmd.AddCommand(versionCmd) |
| 20 | rootCmd.Version = Version | 20 | rootCmd.Version = Version |
| 21 | + // `rickub --version` prints the same line as `rickub version`. | ||
| 22 | + rootCmd.SetVersionTemplate(fmt.Sprintf("rickub {{.Version}} (%s/%s)\n", runtime.GOOS, runtime.GOARCH)) | ||
| 21 | } | 23 | } |