From: Rafael Garcia-Suarez Date: Fri, 22 Apr 2005 16:17:36 +0000 (+0000) Subject: Patch by Yves Orton to accept several options on the corelist(1) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=567f8e5b1e23f102b4f20b5ec9c24fe82bf9fd13;p=p5sagit%2Fp5-mst-13.2.git Patch by Yves Orton to accept several options on the corelist(1) command-line. Plus POD nits. p4raw-id: //depot/perl@24300 --- diff --git a/lib/Module/CoreList.pm b/lib/Module/CoreList.pm index b95e49e..24d1d06 100644 --- a/lib/Module/CoreList.pm +++ b/lib/Module/CoreList.pm @@ -1,7 +1,7 @@ package Module::CoreList; use strict; use vars qw/$VERSION %released %version %families/; -$VERSION = '2.00'; +$VERSION = '2.01'; =head1 NAME diff --git a/lib/Module/CoreList/bin/corelist b/lib/Module/CoreList/bin/corelist index 639cfd0..67b68c6 100644 --- a/lib/Module/CoreList/bin/corelist +++ b/lib/Module/CoreList/bin/corelist @@ -10,11 +10,13 @@ See L for one. =head1 SYNOPSIS - corelist [-help] [-a] [-man] [-v [ version ]] [ Modulename [ version ]] + corelist [-help] [-a] [-man] [-v [ version ]] [ Modulename [ version ]] ... =head1 OPTIONS -=head2 a +=over + +=item -a modulename corelist -a utf8 @@ -32,22 +34,24 @@ See L for one. 5.008006 1.04 5.009 1.02 5.009001 1.02 + 5.009002 1.04 -=head2 -? +=item -? help! help! help! to see more help, try --man. -=head2 man +=item -man all of the help -=head2 v +=item -v lists all of the perl release versions we got the CoreList for. If you pass a version argument (value of $], like 5.00503), you get a list of all the modules and their respective versions. +=back =cut @@ -78,8 +82,17 @@ if(exists $Opts{v} ){ print "$_\n" for sort keys %Module::CoreList::version; print "\n"; } -}elsif(@ARGV){ - module_version(@ARGV); +} elsif (@ARGV) { + while (@ARGV) { + my ($mod, $ver); + if ($ARGV[0] =~ /=/) { + ($mod, $ver) = split /=/, shift @ARGV; + } else { + $mod = shift @ARGV; + $ver = (@ARGV && $ARGV[0] =~ /^\d/) ? shift @ARGV : ""; + } + module_version($mod,$ver); + } } else { pod2usage(0); } @@ -103,10 +116,9 @@ sub module_version { } print "\n",$msg,"\n"; - + if(defined $ret and exists $Opts{a} and $Opts{a}){ for my $v( -# grep { $ret ne $_ } sort keys %Module::CoreList::version ){ printf " %-10s %-10s\n", @@ -138,10 +150,12 @@ sub module_version { File::Spec::Aliens was not in CORE (or so I think) - =head1 COPYRIGHT -Copyright (c) 2002-2003 by D.H. aka PodMaster +Copyright (c) 2002-2005 by D.H. aka PodMaster + +Current maintainer : Rafael Garcia-Suarez Ergarciasuarez at mandriva dot +comE This program is distributed under the same terms as perl itself. See http://perl.com or http://cpan.org for more info on that.