Implement version in chub
This commit is contained in:
parent
9aa3189738
commit
2cd22b45bb
|
@ -1,11 +1,25 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "github.com/spf13/cobra"
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/version"
|
||||||
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
versionCmd = &cobra.Command{
|
versionCmd = &cobra.Command{
|
||||||
Use: "version",
|
Use: "version",
|
||||||
Short: "Print the app 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)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue