diff options
author | Tulir Asokan <tulir@maunium.net> | 2020-06-17 13:20:43 +0300 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2020-06-17 13:20:43 +0300 |
commit | f8b386a08fa5eacb5071e4b1d0d73e06f206824e (patch) | |
tree | 31ee6e80c970a35eff0b0972d7525a44e95a9246 | |
parent | 2f48e13764c98df6057765b44648d1abed49ed39 (diff) | |
parent | 1e110a47999934e5b49413fc55e0fa1d64e82a98 (diff) |
Merge remote-tracking branch 'aaronraimist/version-flag'
-rw-r--r-- | main.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -18,6 +18,7 @@ package main import ( "errors" + "flag" "fmt" "os" "path/filepath" @@ -74,6 +75,14 @@ func main() { gmx := NewGomuks(MainUIProvider, configDir, dataDir, cacheDir, downloadDir) + + isVersion := flag.Bool("version", false, "Display gomuks version and exit") + flag.Parse() + if *isVersion { + fmt.Printf("gomuks version %s\n", gmx.Version()) + os.Exit(0) + } + gmx.Start() // We use os.Exit() everywhere, so exiting by returning from Start() shouldn't happen. |