worker: exit(2) when address is missing from argv
Address is always required so not passing one is a clear error, let's return exit code 2 which go itself returns when bad arguments are passed in. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
6e92263c23
commit
6e9901fe6b
1 changed files with 1 additions and 1 deletions
|
|
@ -157,7 +157,6 @@ func main() {
|
|||
flag.Usage = func() {
|
||||
fmt.Fprintf(flag.CommandLine.Output(), "Usage: %s [-unix] address\n", os.Args[0])
|
||||
flag.PrintDefaults()
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
flag.Parse()
|
||||
|
|
@ -165,6 +164,7 @@ func main() {
|
|||
address := flag.Arg(0)
|
||||
if address == "" {
|
||||
flag.Usage()
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
_, err := toml.DecodeFile(configFile, &config)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue