Change version format
This commit is contained in:
parent
dfa5d41a6d
commit
d5db68dbfa
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user