2018-01-18 03:19:41 -08:00
|
|
|
package main
|
|
|
|
|
2018-01-18 03:38:25 -08:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
|
|
|
|
"github.com/cosmos/cosmos-sdk/version"
|
|
|
|
)
|
2018-01-18 03:19:41 -08:00
|
|
|
|
|
|
|
var (
|
2018-01-18 06:34:45 -08:00
|
|
|
// VersionCmd prints out the current sdk version
|
|
|
|
VersionCmd = &cobra.Command{
|
2018-01-18 03:19:41 -08:00
|
|
|
Use: "version",
|
|
|
|
Short: "Print the app version",
|
2018-01-18 03:38:25 -08:00
|
|
|
Run: doVersionCmd,
|
2018-01-18 03:19:41 -08:00
|
|
|
}
|
|
|
|
)
|
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)
|
|
|
|
}
|