diff --git a/_example/example.go b/_example/example.go index 9d8d707..136af5a 100644 --- a/_example/example.go +++ b/_example/example.go @@ -32,8 +32,10 @@ func main() { } flag.Parse() if *username == "" || *password == "" { - if *debug { + if *debug && *username == "" && *password == "" { fmt.Fprintf(os.Stderr, "no username or password were given; attempting ANONYMOUS auth\n") + } else if *username != "" || *password != "" { + flag.Usage() } }