cmd/version.go
changeset 0 5abace724584
child 3 71812d67a16b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cmd/version.go	Wed Apr 19 19:08:47 2017 +0200
@@ -0,0 +1,27 @@
+// Copyright © 2017 Mikael Berthe <mikael@lilotux.net>
+//
+// Licensed under the MIT license.
+// Please see the LICENSE file is this directory.
+
+package cmd
+
+import (
+	"fmt"
+
+	"github.com/spf13/cobra"
+)
+
+// VERSION of the madonctl application
+var VERSION = "0.0.9"
+
+var versionCmd = &cobra.Command{
+	Use:   "version",
+	Short: "Display " + AppName + " version",
+	Run: func(cmd *cobra.Command, args []string) {
+		fmt.Printf("This is %s version %s\n", AppName, VERSION)
+	},
+}
+
+func init() {
+	RootCmd.AddCommand(versionCmd)
+}