aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/main.go b/main.go
index 1c61021..b7dd598 100644
--- a/main.go
+++ b/main.go
@@ -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.