* aclocal.in (parse_arguments): Diagnose abbreviation ambiguous with
authorAlexandre Duret-Lutz <adl@gnu.org>
Mon, 22 Nov 2004 00:03:29 +0000 (00:03 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Mon, 22 Nov 2004 00:03:29 +0000 (00:03 +0000)
--help or --version.
* automake.in (parse_arguments): Likewise.
* tests/aclocal.test, tests/automake.test: Check this.
Report from Eric Blake.

ChangeLog
aclocal.in
automake.in
tests/aclocal.test
tests/automake.test

index 4a60f58..b7889a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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
index 1f8583a..5314ffe 100644 (file)
@@ -659,9 +659,10 @@ sub parse_arguments ()
     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)
index 9437f92..4a085ef 100755 (executable)
@@ -7474,9 +7474,10 @@ sub parse_arguments ()
     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)
index 9ad7f5d..6a64b38 100755 (executable)
@@ -35,4 +35,10 @@ $ACLOCAL --unknown-option 2>stderr && exit 1
 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"
index 60dceca..5b4f013 100755 (executable)
@@ -37,3 +37,6 @@ AUTOMAKE_fails --warnings
 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