]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/Autom4te/General.pm (getopt): Use a more GNUish error
authorAkim Demaille <akim@epita.fr>
Mon, 21 Jan 2002 13:00:52 +0000 (13:00 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 21 Jan 2002 13:00:52 +0000 (13:00 +0000)
message on invalid options.
* bin/autom4te.in (parse_args): Don't use
Autoconf::General::getopt with non valid options.

ChangeLog
bin/autom4te.in
lib/Autom4te/General.pm
man/autom4te.1

index 2dc7ff6e870d4085ec929fc655b2ff7a489ddc1d..a6317d88bab82bd7d46e464c69343c4a732019ba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-01-21  Akim Demaille  <akim@epita.fr>
+
+       * lib/Autom4te/General.pm (getopt): Use a more GNUish error
+       message on invalid options.
+       * bin/autom4te.in (parse_args): Don't use
+       Autoconf::General::getopt with non valid options.
+
 2002-01-17  Jim Meyering  <meyering@lucent.com>
 
        * lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_DEFAULT): Initialize
index 9a70e6a2ff69217adc7cee3aa63a85881c6aa435..1b54b3497dd67cdcbe8841e13ce901997f82e24a 100644 (file)
@@ -459,8 +459,9 @@ sub parse_args ()
   my @language;
   do {
     @language = ();
+    use Getopt::Long;
     Getopt::Long::Configure ("pass_through");
-    getopt ("l|language=s" => \@language);
+    GetOptions ("l|language=s" => \@language);
 
     foreach (@language)
       {
@@ -474,7 +475,6 @@ sub parse_args ()
 
   # Process the arguments for real this time.
   my @trace;
-  Getopt::Long::Configure ("defaults");
   getopt
     (
      # Operation modes:
index 52cf402a6b69401ed31acee71917fc7c25d72dfc..7cf43123ab4f81b639d570885431426596f2822f 100644 (file)
@@ -275,18 +275,26 @@ sub getopt (%)
   # If fixed some day, use this: '' => sub { push @ARGV, "-" }
   my $stdin = grep /^-$/, @ARGV;
   @ARGV = grep !/^-$/, @ARGV;
-  %option = (%option,
-            "h|help"     => sub { print $help; exit 0 },
+  %option = ("h|help"     => sub { print $help; exit 0 },
              "V|version"  => sub { print $version; exit 0 },
 
              "v|verbose"    => \$verbose,
              "d|debug"      => \$debug,
             'f|force'      => \$force,
-           );
-  Getopt::Long::Configure ("bundling");
+
+            # User options last, so that they have precedence.
+            %option);
+  Getopt::Long::Configure ("bundling", "pass_through");
   GetOptions (%option)
     or exit 1;
 
+  foreach (grep { /^-./ } @ARGV)
+    {
+      print STDERR "$0: unrecognized option `$_'\n";
+      print STDERR "Try `$0 --help' for more information.\n";
+      exit (1);
+    }
+
   push @ARGV, '-'
     if $stdin;
 }
index ee70108c15845366e63f041e7254d627f3214741..0f98fc3ece68c275af040c2c79d0f0656982c2fb 100644 (file)
@@ -1,5 +1,5 @@
-.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.24.
-.TH AUTOM4TE "1" "November 2001" "GNU Autoconf 2.52g" FSF
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.25.
+.TH AUTOM4TE "1" "January 2002" "autom4te 2.52g" "User Commands"
 .SH NAME
 autom4te \- Generate files and scripts thanks to M4
 .SH SYNOPSIS