2021-02-14 00:42:47 +00:00
|
|
|
package lumecmd
|
|
|
|
|
2021-02-28 04:42:09 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
2021-03-02 06:44:38 +00:00
|
|
|
"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) {
|
2021-03-02 06:44:38 +00:00
|
|
|
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
|
|
|
|
}
|