diff --git a/cmd/embed/help b/cmd/embed/help index 622be43..ffe95b4 100644 --- a/cmd/embed/help +++ b/cmd/embed/help @@ -19,4 +19,8 @@ ENVIRONMENT VARIABLES KKS_SESSION Kakoune session KKS_CLIENT Kakoune client +FLAGS + -v print version + -h print help + Use "kks -h" for command usage. diff --git a/main.go b/main.go index 31c081a..55df9b7 100644 --- a/main.go +++ b/main.go @@ -1,14 +1,23 @@ package main import ( + "fmt" "log" "os" "github.com/kkga/kks/cmd" ) +var version = "dev" + func main() { log.SetFlags(0) + + if len(os.Args) > 1 && os.Args[1] == "-v" { + fmt.Printf("kks %s\n", version) + os.Exit(0) + } + if err := cmd.Root(os.Args[1:]); err != nil { log.Fatal(err) }