lume/cmd/version.go

27 lines
488 B
Go
Raw Normal View History

2021-02-14 00:42:47 +00:00
package lumecmd
2021-02-28 04:42:09 +00:00
import (
"fmt"
"runtime"
2021-02-28 04:42:09 +00:00
)
func NewCmdVersion() Command {
return Command{
Name: "version",
Func: VersionCmd,
Flags: nil,
Use: "",
Short: "Show version",
}
}
func VersionCmd(args CmdArgs) (int, error) {
fmt.Printf("lume %s\n", Version)
fmt.Printf(" os/arch: %s/%s\n", runtime.GOOS, runtime.GOARCH)
fmt.Printf(" go version: %s\n", runtime.Version())
2021-03-03 02:41:18 +00:00
if BuildDate != "" {
fmt.Printf(" build date: %s\n", BuildDate)
}
2021-02-28 04:42:09 +00:00
return ExitSuccess, nil
}