From d9d429f9f0878349a155bb394a927363d8141f9e Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 17 Jun 2020 13:25:35 +0300 Subject: [PATCH] Simplify version flag --- main.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/main.go b/main.go index b7dd598..5c3c6ff 100644 --- a/main.go +++ b/main.go @@ -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) }