1
0
mirror of https://github.com/taigrr/wtf synced 2026-03-26 00:22:21 -07:00

Move responsibility for version display out of flags

This commit is contained in:
Chris Cummer
2018-06-16 08:37:55 -07:00
parent 4a00c114ce
commit dd42080ed8
3 changed files with 13 additions and 10 deletions

8
wtf.go
View File

@@ -266,6 +266,12 @@ func main() {
if flags.HasModule() {
help.Display(flags.Module)
os.Exit(0)
}
if flags.HasVersion() {
fmt.Println(version)
os.Exit(0)
}
cfg.CreateConfigDir()
@@ -289,7 +295,7 @@ func main() {
go watchForConfigChanges(app, flags.Config, display.Grid, pages)
if err := app.SetRoot(pages, true).Run(); err != nil {
fmt.Printf("An error occurred: %v\n", err)
fmt.Printf("Error: %v\n", err)
os.Exit(1)
}