Remove ExtUtils::MM_Haiku
[p5sagit/p5-mst-13.2.git] / lib / CPAN / bin / cpan
index 83044ae..52a1b20 100644 (file)
@@ -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<< <bdfoy@cpan.org> >>
@@ -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"; }