You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
osem_notify/cmd/cmd_version.go

27 lines
490 B
Go

package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
// TODO: insert automatically via build step?
const (
VERSION = "1.1.1"
BUILDDATE = "2018-07-04T19:42:00+02"
)
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)
},
}