mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-19 18:13:41 -05:00
Add --version flag
This commit is contained in:
parent
2f48e13764
commit
1e110a4799
1 changed files with 9 additions and 0 deletions
9
main.go
9
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.
|
||||
|
|
Loading…
Add table
Reference in a new issue