From 27bb85f9e8ceb9440c40fde4b31dbd542d93160c Mon Sep 17 00:00:00 2001 From: yory8 <> Date: Fri, 2 Aug 2019 13:51:13 +0200 Subject: [PATCH] nicer output on missing options --- main.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index daf9ab3..fd5f922 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( "encoding/json" + "fmt" "io/ioutil" "log" "os" @@ -30,10 +31,11 @@ func main() { modeCount++ } if modeCount != 1 { - log.Print("Missing or incompatible options. You must provide exactly one of these:") - log.Print(" -d, --demon") - log.Print(" -s, --select") - log.Fatal("See -h/--help for info") + fmt.Println("Missing or incompatible options. You must provide exactly one of these:") + fmt.Println(" -d, --demon") + fmt.Println(" -s, --select") + fmt.Println("See -h/--help for info") + os.Exit(1) } h, err := os.UserHomeDir()