26 lines
382 B
Go
26 lines
382 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/cosmos/cosmos-sdk/version"
|
|
)
|
|
|
|
var (
|
|
versionCmd = &cobra.Command{
|
|
Use: "version",
|
|
Short: "Print the app version",
|
|
Run: doVersionCmd,
|
|
}
|
|
)
|
|
|
|
func doVersionCmd(cmd *cobra.Command, args []string) {
|
|
v := version.Version
|
|
if version.GitCommit != "" {
|
|
v = v + " " + version.GitCommit
|
|
}
|
|
fmt.Println(v)
|
|
}
|