diff --git a/main.go b/main.go index 9c3dd2d..3a1e9ac 100644 --- a/main.go +++ b/main.go @@ -41,7 +41,6 @@ func main() { do := os.Getenv("DNSSEC") == "1" subnetOpt := getSubnet() ednsOpt := getEDNSOpt() - question := getQuestion() if verbose { log.SetLevel(log.DEBUG) @@ -66,12 +65,14 @@ func main() { os.Exit(0) } - if len(os.Args) != 2 && len(os.Args) != 3 && len(os.Args) != 4 && len(os.Args) != 5 { + if len(os.Args) < 2 || len(os.Args) > 5 { log.Printf("Wrong number of arguments") usage() os.Exit(1) } + question := getQuestion() + if timeoutStr != "" { i, err := strconv.Atoi(timeoutStr) if err != nil {