Browse Source

Compact flag.NArg validation switch

xno
codesoap 11 months ago
parent
commit
1f71cd087d
  1. 6
      main.go

6
main.go

@ -57,11 +57,7 @@ func init() { @@ -57,11 +57,7 @@ func init() {
}
var ok bool
switch flag.Arg(0)[:1] {
case "n":
ok = flag.NArg() == 1
case "a":
ok = flag.NArg() == 1
case "b":
case "n", "a", "b":
ok = flag.NArg() == 1
case "r":
ok = flag.NArg() == 2

Loading…
Cancel
Save