cosmos-sdk/examples/gaia/gaiacli/version.go

27 lines
432 B
Go
Raw Normal View History

package main
2018-01-18 03:38:25 -08:00
import (
"fmt"
"github.com/spf13/cobra"
"github.com/cosmos/cosmos-sdk/version"
)
var (
// VersionCmd prints out the current sdk version
VersionCmd = &cobra.Command{
Use: "version",
Short: "Print the app version",
2018-01-18 03:38:25 -08:00
Run: doVersionCmd,
}
)
2018-01-18 03:38:25 -08:00
func doVersionCmd(cmd *cobra.Command, args []string) {
v := version.Version
if version.GitCommit != "" {
v = v + " " + version.GitCommit
}
fmt.Println(v)
}