diff options
author | Tulir Asokan <tulir@maunium.net> | 2020-06-17 13:25:35 +0300 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2020-06-17 13:25:35 +0300 |
commit | d9d429f9f0878349a155bb394a927363d8141f9e (patch) | |
tree | 19d73a77a291e520ffd8087b64982c05f43abbde | |
parent | f8b386a08fa5eacb5071e4b1d0d73e06f206824e (diff) |
Simplify version flag
-rw-r--r-- | main.go | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -18,7 +18,6 @@ package main import ( "errors" - "flag" "fmt" "os" "path/filepath" @@ -76,9 +75,7 @@ func main() { gmx := NewGomuks(MainUIProvider, configDir, dataDir, cacheDir, downloadDir) - isVersion := flag.Bool("version", false, "Display gomuks version and exit") - flag.Parse() - if *isVersion { + if len(os.Args) > 1 && (os.Args[1] == "--version" || os.Args[1] == "-v") { fmt.Printf("gomuks version %s\n", gmx.Version()) os.Exit(0) } |