Implement version in chub

This commit is contained in:
Ethan Frey
2018-02-13 08:40:09 -05:00
committed by Ethan Buchman
parent 9aa3189738
commit 2cd22b45bb
+16 -2
View File
@@ -1,11 +1,25 @@
package main
import "github.com/spf13/cobra"
import (
"fmt"
"github.com/spf13/cobra"
"github.com/cosmos/cosmos-sdk/version"
)
var (
versionCmd = &cobra.Command{
Use: "version",
Short: "Print the app version",
RunE: todoNotImplemented,
Run: doVersionCmd,
}
)
func doVersionCmd(cmd *cobra.Command, args []string) {
v := version.Version
if version.GitCommit != "" {
v = v + " " + version.GitCommit
}
fmt.Println(v)
}