| Initial import of the rickub CLI as a standalone public project 1a1d430 Olivier Girardot 9h ago | 1 | package cmd |
| 2 | |
| 3 | import ( |
| 4 | "fmt" |
| 5 | "runtime" |
| 6 | |
| 7 | "github.com/spf13/cobra" |
| 8 | ) |
| 9 | |
| 10 | func init() { |
| 11 | versionCmd := &cobra.Command{ |
| 12 | Use: "version", |
| 13 | Short: "Print the rickub CLI version", |
| 14 | Args: cobra.NoArgs, |
| 15 | Run: func(cmd *cobra.Command, _ []string) { |
| 16 | fmt.Fprintf(cmd.OutOrStdout(), "rickub %s (%s/%s)\n", Version, runtime.GOOS, runtime.GOARCH) |
| 17 | }, |
| 18 | } |
| 19 | rootCmd.AddCommand(versionCmd) |
| 20 | rootCmd.Version = Version |
| 21 | } |