diff --git a/cmd/version.go b/cmd/version.go index 463f2d3..312a164 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -2,6 +2,7 @@ package lumecmd import ( "fmt" + "runtime" "strings" ) @@ -18,16 +19,19 @@ func NewCmdVersion() Command { func VersionCmd(args CmdArgs) (int, error) { var b strings.Builder - fmt.Fprintf(&b, "lume %s", Version) - b.WriteString(" ") + fmt.Fprintf(&b, "lume, version %s\n", Version) + if GitCommit != "" { - fmt.Fprintf(&b, "(git: %s)", GitCommit) - b.WriteString(" ") + fmt.Fprintf(&b, " revision: %s\n", GitCommit) } if BuildDate != "" { - fmt.Fprintf(&b, "build_date: %s", BuildDate) + fmt.Fprintf(&b, " build date: %s\n", BuildDate) } - fmt.Println(b.String()) + fmt.Fprintf(&b, " go version: %s\n", runtime.Version()) + fmt.Fprintf(&b, " platform: %s\n", runtime.GOOS+"/"+runtime.GOARCH) + + fmt.Print(b.String()) + return ExitSuccess, nil }