diff --git a/cmd/cmd_root.go b/cmd/cmd_root.go index e0a3d42..367b214 100644 --- a/cmd/cmd_root.go +++ b/cmd/cmd_root.go @@ -104,6 +104,7 @@ var rootCmd = &cobra.Command{ Use: "osem_notify", Short: "Root command displaying help", Long: "Run healthchecks and send notifications for boxes on opensensemap.org", + Version: "1.3.0", PersistentPreRunE: func(cmd *cobra.Command, args []string) error { // set up logger log.SetOutput(os.Stdout) diff --git a/cmd/cmd_version.go b/cmd/cmd_version.go deleted file mode 100644 index e8ae502..0000000 --- a/cmd/cmd_version.go +++ /dev/null @@ -1,26 +0,0 @@ -package cmd - -import ( - "fmt" - - "github.com/spf13/cobra" -) - -// TODO: insert automatically via build step? -const ( - VERSION = "1.3.0" - BUILDDATE = "2019-02-10T16:00:00+00" -) - -func init() { - rootCmd.AddCommand(versionCmd) -} - -var versionCmd = &cobra.Command{ - Use: "version", - Short: "Get build and version information", - Long: "osem_notify version returns its build and version information", - Run: func(cmd *cobra.Command, args []string) { - fmt.Printf("%s %s", VERSION, BUILDDATE) - }, -}