Simplify version flag

This commit is contained in:
Tulir Asokan 2020-06-17 13:25:35 +03:00
parent f8b386a08f
commit d9d429f9f0

View File

@ -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)
}