diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-18 05:12:00 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-18 05:12:00 +0000 |
commit | bee0ef1e2feb5d6867ff3a1c6e5049ad71c9c0f2 (patch) | |
tree | 4220271ef42aae89398e91add3af9ecf09050e5b /lib/Getopt | |
parent | 11416672a1609b58961b3705883705a72765af20 (diff) | |
download | perl-bee0ef1e2feb5d6867ff3a1c6e5049ad71c9c0f2.tar.gz |
Getopt::Long 2.23 update (from Johan Vromans)
p4raw-id: //depot/perl@5799
Diffstat (limited to 'lib/Getopt')
-rw-r--r-- | lib/Getopt/Long.pm | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/lib/Getopt/Long.pm b/lib/Getopt/Long.pm index f9aa2e59dd..f474c7c4a9 100644 --- a/lib/Getopt/Long.pm +++ b/lib/Getopt/Long.pm @@ -36,7 +36,7 @@ BEGIN { require 5.004; use Exporter (); use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - $VERSION = "2.22"; + $VERSION = "2.23"; @ISA = qw(Exporter); @EXPORT = qw(&GetOptions $REQUIRE_ORDER $PERMUTE $RETURN_IN_ORDER); @@ -108,12 +108,12 @@ __END__ ################ AutoLoading subroutines ################ -# RCS Status : $Id: GetoptLongAl.pl,v 2.26 2000-03-14 21:32:05+01 jv Exp $ +# RCS Status : $Id: GetoptLongAl.pl,v 2.27 2000-03-17 09:07:26+01 jv Exp $ # Author : Johan Vromans # Created On : Fri Mar 27 11:50:30 1998 # Last Modified By: Johan Vromans -# Last Modified On: Tue Mar 14 21:09:46 2000 -# Update Count : 50 +# Last Modified On: Fri Mar 17 09:00:09 2000 +# Update Count : 55 # Status : Released sub GetOptions { @@ -137,7 +137,7 @@ sub GetOptions { print STDERR ("GetOpt::Long $Getopt::Long::VERSION ", "called from package \"$pkg\".", "\n ", - 'GetOptionsAl $Revision: 2.26 $ ', + 'GetOptionsAl $Revision: 2.27 $ ', "\n ", "ARGV: (@ARGV)", "\n ", @@ -423,8 +423,10 @@ sub GetOptions { &{$linkage{$opt}}($opt, $arg); }; print STDERR ("=> die($@)\n") if $debug && $@ ne ''; - if ( $@ =~ /^FINISH\b/ ) { - $goon = 0; + if ( $@ =~ /^!/ ) { + if ( $@ =~ /^!FINISH\b/ ) { + $goon = 0; + } } elsif ( $@ ne '' ) { warn ($@); @@ -491,8 +493,10 @@ sub GetOptions { &$cb ($tryopt); }; print STDERR ("=> die($@)\n") if $debug && $@ ne ''; - if ( $@ =~ /^FINISH\b/ ) { - $goon = 0; + if ( $@ =~ /^!/ ) { + if ( $@ =~ /^!FINISH\b/ ) { + $goon = 0; + } } elsif ( $@ ne '' ) { warn ($@); @@ -1129,10 +1133,10 @@ the desired error message as its argument. GetOptions() will catch the die(), issue the error message, and record that an error result must be returned upon completion. -It is also possible for a user-defined subroutine to preliminary -terminate options processing by calling die() with argument -C<"FINISH">. GetOptions will react as if it encountered a double dash -C<-->. +If the text of the error message starts with an exclamantion mark C<!> +it is interpreted specially by GetOptions(). There is currently one +special command implemented: C<die("!FINISH")> will cause GetOptions() +to stop processing options, as if it encountered a double dash C<-->. =head2 Options with multiple names |