version.go
| 1 | package cmd |
| 2 | |
| 3 | import ( |
| 4 | "fmt" |
| 5 | |
| 6 | "github.com/spf13/cobra" |
| 7 | ) |
| 8 | |
| 9 | var versionCmd = &cobra.Command{ |
| 10 | Use: "version", |
| 11 | Short: "Print version information", |
| 12 | Run: func(cmd *cobra.Command, args []string) { |
| 13 | fmt.Printf("claudio %s\n", Version) |
| 14 | }, |
| 15 | } |
| 16 | |
| 17 | func init() { |
| 18 | rootCmd.AddCommand(versionCmd) |
| 19 | } |
| 20 |