OSDN Git Service

Hulk did something
[bytom/vapor.git] / cmd / bytomcli / commands / version.go
diff --git a/cmd/bytomcli/commands/version.go b/cmd/bytomcli/commands/version.go
new file mode 100644 (file)
index 0000000..5bfa3fd
--- /dev/null
@@ -0,0 +1,18 @@
+package commands
+
+import (
+       "runtime"
+
+       "github.com/spf13/cobra"
+       jww "github.com/spf13/jwalterweatherman"
+
+       "github.com/vapor/version"
+)
+
+var versionCmd = &cobra.Command{
+       Use:   "version",
+       Short: "Print the version number of Bytomcli",
+       Run: func(cmd *cobra.Command, args []string) {
+               jww.FEEDBACK.Printf("Bytomcli v%s %s/%s\n", version.Version, runtime.GOOS, runtime.GOARCH)
+       },
+}