bench: die clearly on incorrect --grammar arguments

* etc/bench.pl.in (getopt): here.
This commit is contained in:
Akim Demaille
2020-03-10 21:04:16 +01:00
parent 466fb66578
commit 675dcf1962

View File

@@ -1100,6 +1100,9 @@ sub getopt ()
Getopt::Long::Configure ("bundling", "pass_through");
GetOptions (%option)
or exit 1;
my %grammars = map { $_ => 1 } qw[calc list triangular];
die "invalid grammar: $grammar, valid: @{[keys %grammars]}\n"
if !exists($grammars{$grammar});
}
######################################################################