Add version command

This commit is contained in:
Ryan Cavicchioni 2021-02-27 22:42:09 -06:00
parent c9e4d9af80
commit 0fac4a3c14
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D
2 changed files with 21 additions and 1 deletions

View File

@ -26,8 +26,11 @@ func init() {
RegisterCommand(NewCmdSetWhite())
RegisterCommand(NewCmdShow())
RegisterCommand(NewCmdToggle())
RegisterCommand(NewCmdVersion())
}
const Version = "0.1.0-pre"
const lumercFile string = ".lumerc"
func Main(args []string) (int, error) {

View File

@ -1,3 +1,20 @@
package lumecmd
const Version = "0.1.0-pre"
import (
"fmt"
)
func NewCmdVersion() Command {
return Command{
Name: "version",
Func: VersionCmd,
Flags: nil,
Use: "",
Short: "Show version",
}
}
func VersionCmd(args CmdArgs) (int, error) {
fmt.Println(Version)
return ExitSuccess, nil
}