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:
Ondřej Budai 2022-04-01 12:01:31 +02:00 committed by Tom Gundersen
parent 6e92263c23
commit 6e9901fe6b

View file

@ -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)