OSDN Git Service

Hulk did something
[bytom/vapor.git] / cmd / bytomd / commands / version.go
diff --git a/cmd/bytomd/commands/version.go b/cmd/bytomd/commands/version.go
new file mode 100644 (file)
index 0000000..91c2622
--- /dev/null
@@ -0,0 +1,21 @@
+package commands
+
+import (
+       "fmt"
+
+       "github.com/spf13/cobra"
+
+       "github.com/vapor/version"
+)
+
+var versionCmd = &cobra.Command{
+       Use:   "version",
+       Short: "Show version info",
+       Run: func(cmd *cobra.Command, args []string) {
+               fmt.Println(version.Version)
+       },
+}
+
+func init() {
+       RootCmd.AddCommand(versionCmd)
+}