From: Steve Peters Date: Tue, 2 Oct 2007 13:56:07 +0000 (+0000) Subject: Upgrade to Getopt-Long-2.37 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4c56f2471f550a189d8c7c4bc89aee7346571b44;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Getopt-Long-2.37 p4raw-id: //depot/perl@32009 --- diff --git a/lib/Getopt/Long.pm b/lib/Getopt/Long.pm index 77a86ad..f44e615 100644 --- a/lib/Getopt/Long.pm +++ b/lib/Getopt/Long.pm @@ -2,12 +2,12 @@ package Getopt::Long; -# RCS Status : $Id: Long.pm,v 2.73 2007/01/27 20:00:34 jv Exp $ +# RCS Status : $Id: Long.pm,v 2.74 2007/09/29 13:40:13 jv Exp $ # Author : Johan Vromans # Created On : Tue Sep 11 15:00:12 1990 # Last Modified By: Johan Vromans -# Last Modified On: Sat Jan 27 20:59:00 2007 -# Update Count : 1552 +# Last Modified On: Sat Sep 29 15:38:55 2007 +# Update Count : 1571 # Status : Released ################ Copyright ################ @@ -35,10 +35,10 @@ use 5.004; use strict; use vars qw($VERSION); -$VERSION = 2.36; +$VERSION = 2.37; # For testing versions only. use vars qw($VERSION_STRING); -$VERSION_STRING = "2.36"; +$VERSION_STRING = "2.37"; use Exporter; use vars qw(@ISA @EXPORT @EXPORT_OK); @@ -305,7 +305,7 @@ sub GetOptionsFromArray($@) { local ($^W) = 0; print STDERR ("Getopt::Long $Getopt::Long::VERSION (", - '$Revision: 2.73 $', ") ", + '$Revision: 2.74 $', ") ", "called from package \"$pkg\".", "\n ", "argv: (@$argv)", @@ -1055,7 +1055,7 @@ sub FindOption ($$$$$) { # Check if there is an option argument available. if ( $gnu_compat && defined $optarg && $optarg eq '' ) { - return (1, $opt, $ctl, $type eq 's' ? '' : 0) unless $mand; + return (1, $opt, $ctl, $type eq 's' ? '' : 0) ;#unless $mand; $optarg = 0 unless $type eq 's'; } @@ -1064,6 +1064,7 @@ sub FindOption ($$$$$) { ? ($optarg eq '') : !(defined $rest || @$argv > 0) ) { # Complain if this option needs an argument. +# if ( $mand && !($type eq 's' ? defined($optarg) : 0) ) { if ( $mand ) { return (0) if $passthrough; warn ("Option ", $opt, " requires an argument\n"); @@ -2257,7 +2258,7 @@ processed. The only exception is when C<--> is used: --foo arg1 --bar arg2 -- arg3 This will call the callback routine for arg1 and arg2, and then -terminate GetOptions() leaving C<"arg2"> in C<@ARGV>. +terminate GetOptions() leaving C<"arg3"> in C<@ARGV>. If C is enabled, options processing terminates when the first non-option is encountered.