diff --git a/examples/chub/version.go b/examples/chub/version.go index 4afcddb99..0c83c1bac 100644 --- a/examples/chub/version.go +++ b/examples/chub/version.go @@ -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) +}