Simplify version flag
This commit is contained in:
parent
f8b386a08f
commit
d9d429f9f0
5
main.go
5
main.go
@ -18,7 +18,6 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"flag"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -76,9 +75,7 @@ func main() {
|
|||||||
|
|
||||||
gmx := NewGomuks(MainUIProvider, configDir, dataDir, cacheDir, downloadDir)
|
gmx := NewGomuks(MainUIProvider, configDir, dataDir, cacheDir, downloadDir)
|
||||||
|
|
||||||
isVersion := flag.Bool("version", false, "Display gomuks version and exit")
|
if len(os.Args) > 1 && (os.Args[1] == "--version" || os.Args[1] == "-v") {
|
||||||
flag.Parse()
|
|
||||||
if *isVersion {
|
|
||||||
fmt.Printf("gomuks version %s\n", gmx.Version())
|
fmt.Printf("gomuks version %s\n", gmx.Version())
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user