Skip to content

Commit

Permalink
add version flag
Browse files Browse the repository at this point in the history
  • Loading branch information
kkga committed Sep 15, 2021
1 parent 0703fd1 commit b0671ee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/embed/help
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ ENVIRONMENT VARIABLES
KKS_SESSION Kakoune session
KKS_CLIENT Kakoune client

FLAGS
-v print version
-h print help

Use "kks <command> -h" for command usage.
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -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)
}
Expand Down

0 comments on commit b0671ee

Please sign in to comment.