()
| 14 | ) |
| 15 | |
| 16 | func versionCmd() *cobra.Command { |
| 17 | return &cobra.Command{ |
| 18 | Use: "version", |
| 19 | Short: "Print version information", |
| 20 | Run: func(cmd *cobra.Command, _ []string) { |
| 21 | resolveVersionFromBuildInfo() |
| 22 | fmt.Fprintf(cmd.OutOrStdout(), "hack-browser-data %s\n commit: %s\n built: %s\n", |
| 23 | version, commit, buildDate) |
| 24 | }, |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | func resolveVersionFromBuildInfo() { |
| 29 | if version != "dev" { |
no test coverage detected