status-go/cmd/statusd/misccmd.go

37 lines
731 B
Go

package main
import (
"fmt"
"os"
"runtime"
"strings"
"github.com/status-im/status-go/geth/params"
"gopkg.in/urfave/cli.v1"
)
var (
versionCommand = cli.Command{
Action: version,
Name: "version",
Usage: "Print app version",
}
)
// version displays app version
func version(ctx *cli.Context) error {
fmt.Println(strings.Title(params.ClientIdentifier))
fmt.Println("Version:", params.Version)
if gitCommit != "" {
fmt.Println("Git Commit:", gitCommit)
}
fmt.Println("Network Id:", ctx.GlobalInt(NetworkIdFlag.Name))
fmt.Println("Go Version:", runtime.Version())
fmt.Println("OS:", runtime.GOOS)
fmt.Printf("GOPATH=%s\n", os.Getenv("GOPATH"))
fmt.Printf("GOROOT=%s\n", runtime.GOROOT())
return nil
}