cmd: Reject non-option arguments

This commit is contained in:
Martin Polden 2020-12-03 22:28:27 +01:00
parent cd687f6343
commit 0d3594284e

View File

@ -42,6 +42,10 @@ func main() {
var headers multiValueFlag
flag.Var(&headers, "H", "Header to trust for remote IP, if present (e.g. X-Real-IP)")
flag.Parse()
if len(flag.Args()) != 0 {
flag.Usage()
return
}
log := log.New(os.Stderr, "echoip: ", 0)
r, err := geo.Open(*countryFile, *cityFile, *asnFile)