package cmd import ( "fmt" "runtime" "github.com/spf13/cobra" ) func init() { versionCmd := &cobra.Command{ Use: "version", Short: "Print the rickub CLI version", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, _ []string) { fmt.Fprintf(cmd.OutOrStdout(), "rickub %s (%s/%s)\n", Version, runtime.GOOS, runtime.GOARCH) }, } rootCmd.AddCommand(versionCmd) rootCmd.Version = Version }