From a30a4b637e98c000b053c847a414b421be4b23ae Mon Sep 17 00:00:00 2001 From: Patrick Koperwas Date: Sun, 28 Jan 2018 20:17:05 -0800 Subject: [PATCH] chore: Add version command --- cmd/version.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 cmd/version.go diff --git a/cmd/version.go b/cmd/version.go new file mode 100644 index 0000000..3081b7e --- /dev/null +++ b/cmd/version.go @@ -0,0 +1,21 @@ +package cmd + +import ( + "fmt" + + "github.com/spf13/cobra" +) + +var version = "master" + +var versionCmd = &cobra.Command{ + Use: "version", + Short: "Print the version number of Tychus", + Run: func(cmd *cobra.Command, args []string) { + fmt.Printf("Tychus Version: %v\n", version) + }, +} + +func init() { + rootCmd.AddCommand(versionCmd) +}