nicer output on missing options
This commit is contained in:
parent
df4b816db7
commit
27bb85f9e8
1 changed files with 6 additions and 4 deletions
10
main.go
10
main.go
|
@ -2,6 +2,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
@ -30,10 +31,11 @@ func main() {
|
||||||
modeCount++
|
modeCount++
|
||||||
}
|
}
|
||||||
if modeCount != 1 {
|
if modeCount != 1 {
|
||||||
log.Print("Missing or incompatible options. You must provide exactly one of these:")
|
fmt.Println("Missing or incompatible options. You must provide exactly one of these:")
|
||||||
log.Print(" -d, --demon")
|
fmt.Println(" -d, --demon")
|
||||||
log.Print(" -s, --select")
|
fmt.Println(" -s, --select")
|
||||||
log.Fatal("See -h/--help for info")
|
fmt.Println("See -h/--help for info")
|
||||||
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
h, err := os.UserHomeDir()
|
h, err := os.UserHomeDir()
|
||||||
|
|
Loading…
Reference in a new issue