--help or --version.
* automake.in (parse_arguments): Likewise.
* tests/aclocal.test, tests/automake.test: Check this.
Report from Eric Blake.
+2004-11-22 Alexandre Duret-Lutz <adl@gnu.org>
+
+ * aclocal.in (parse_arguments): Diagnose abbreviation ambiguous with
+ --help or --version.
+ * automake.in (parse_arguments): Likewise.
+ * tests/aclocal.test, tests/automake.test: Check this.
+ Report from Eric Blake.
+
2004-11-21 Alexandre Duret-Lutz <adl@gnu.org>
* automake.in (parse_arguments): Diagnose empty arguments, options
or exit 1;
@ARGV = @ARGV_backup;
- # Now *really* process the options. This time we know
- # that --help and --version are not present.
- Getopt::Long::GetOptions %cli_options
+ # Now *really* process the options. This time we know that --help
+ # and --version are not present, but we specify them nonetheless so
+ # that ambiguous abbreviation are diagnosed.
+ Getopt::Long::GetOptions %cli_options, 'version' => sub {}, 'help' => sub {}
or exit 1;
if (@ARGV)
or exit 1;
@ARGV = @ARGV_backup;
- # Now *really* process the options. This time we know
- # that --help and --version are not present.
- Getopt::Long::GetOptions %cli_options
+ # Now *really* process the options. This time we know that --help
+ # and --version are not present, but we specify them nonetheless so
+ # that ambiguous abbreviation are diagnosed.
+ Getopt::Long::GetOptions %cli_options, 'version' => sub {}, 'help' => sub {}
or exit 1;
if (defined $output_directory)
grep 'unrecognized.*--unknown-option' stderr
grep help stderr
+$ACLOCAL --ver 2>stderr && exit 1
+grep 'unrecognized.*--ver' stderr
+grep help stderr
+
+$ACLOCAL --versi
+
test "`$ACLOCAL --print-ac-dir`" = "$testaclocaldir"
grep 'option.*--warning.*requires an argument' stderr
AUTOMAKE_fails --warnings --help
grep 'unknown warning.*--help' stderr
+AUTOMAKE_fails --ver
+grep 'unrecognized option.*--ver' stderr
+$AUTOMAKE --vers