X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCPAN%2Fbin%2Fcpan;h=52a1b20f22b309b9de23509300940c5bf8750901;hb=6fea91d48c4e490e2fa422b26e5ff3883c86f34c;hp=83044aecccf12f967867d54d74ad45480d414173;hpb=9ddc4ed0d78d3f27114dba4c8b582621702194a5;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/CPAN/bin/cpan b/lib/CPAN/bin/cpan index 83044ae..52a1b20 100644 --- a/lib/CPAN/bin/cpan +++ b/lib/CPAN/bin/cpan @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: cpan,v 1.7 2006/01/11 06:22:32 comdog Exp $ +# $Id: cpan,v 1.9 2006/11/01 21:49:31 comdog Exp $ use strict; =head1 NAME @@ -14,7 +14,7 @@ cpan - easily interact with CPAN from the command line # with switches, installs modules with extra behavior cpan [-cfimt] module_name [ module_name ... ] - # without arguments, starts CPAN shell + # without arguments, starts CPAN.pm shell cpan # without arguments, but some switches @@ -22,7 +22,9 @@ cpan - easily interact with CPAN from the command line =head1 DESCRIPTION -This script provides a command interface (not a shell) to CPAN.pm. +This script provides a command interface (not a shell) to CPAN. At the +moment it uses CPAN.pm to do the work, but it is not a one-shot command +runner for CPAN.pm. =head2 Meta Options @@ -152,6 +154,9 @@ Japheth Cleaver added the bits to allow a forced install (-f). Jim Brandt suggest and provided the initial implementation for the up-to-date and Changes features. +Adam Kennedy pointed out that exit() causes problems on Windows +where this script ends up with a .bat extension + =head1 AUTHOR brian d foy, C<< >> @@ -168,8 +173,25 @@ use CPAN (); use Getopt::Std; my $VERSION = - sprintf "%d.%d", q$Revision: 403 $ =~ m/ (\d+) \. (\d+) /xg; + sprintf "%d.%d", q$Revision: 1.9 $ =~ m/ (\d+) \. (\d+) /xg; + +if( $ARGV[0] eq 'install' ) + { + my @args = @ARGV; + shift @args; + + die <<"HERE"; +It looks like you specified 'install' as an argument to cpan(1). This +script is not the CPAN.pm prompt and doesn't understand the same commands. +In fact, doesn't require the extra typing. You probably just want to +list the modules you want to install: + cpan @args + +See the documentation for more details on using this script. +HERE + } + if( 0 == @ARGV ) { CPAN::shell(); exit 0 } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # @@ -279,7 +301,7 @@ sub _default # 2. with no switches and no args, start the shell # 3. With a switch but no args, die! These switches need arguments. if( not $switch and @$args ) { $switch = $Default; } - elsif( not $switch and not @$args ) { CPAN::shell(); exit 0; } + elsif( not $switch and not @$args ) { CPAN::shell(); return } elsif( $switch and not @$args ) { die "Nothing to $CPAN_METHODS{$switch}!\n"; }