From 675dcf1962475de1e9a05f6d26bfb823c00c8a74 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 10 Mar 2020 21:04:16 +0100 Subject: [PATCH] bench: die clearly on incorrect --grammar arguments * etc/bench.pl.in (getopt): here. --- etc/bench.pl.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etc/bench.pl.in b/etc/bench.pl.in index 153ae55d..6460a90c 100755 --- a/etc/bench.pl.in +++ b/etc/bench.pl.in @@ -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}); } ######################################################################