From 04ce200f8bf7486de16c3a44e5f34b1a72a91542 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Wed, 16 Sep 2009 09:43:23 +0000 Subject: Bug 445875: Make it possible to open a CPAN shell with install-module Patch by Marcus Pallinger r=mkanat, a=mkanat --- install-module.pl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'install-module.pl') diff --git a/install-module.pl b/install-module.pl index 936618987..241972211 100755 --- a/install-module.pl +++ b/install-module.pl @@ -43,7 +43,7 @@ use Pod::Usage; our %switch; GetOptions(\%switch, 'all|a', 'upgrade-all|u', 'show-config|s', 'global|g', - 'help|h'); + 'shell', 'help|h'); pod2usage({ -verbose => 1 }) if $switch{'help'}; @@ -58,8 +58,8 @@ pod2usage({ -verbose => 0 }) if (!%switch && !@ARGV); set_cpan_config($switch{'global'}); if ($switch{'show-config'}) { - print Dumper($CPAN::Config); - exit; + print Dumper($CPAN::Config); + exit; } my $can_notest = 1; @@ -69,6 +69,11 @@ if (substr(CPAN->VERSION, 0, 3) < 1.8) { print "* You can upgrade CPAN by doing: $^X install-module.pl CPAN\n"; } +if ($switch{'shell'}) { + CPAN::shell(); + exit; +} + if ($switch{'all'} || $switch{'upgrade-all'}) { my @modules; if ($switch{'upgrade-all'}) { @@ -114,6 +119,7 @@ This script does not run on Windows. ./install-module.pl --all [--global] ./install-module.pl --upgrade-all [--global] ./install-module.pl --show-config + ./install-module.pl --shell Do "./install-module.pl --help" for more information. @@ -154,6 +160,10 @@ have them installed. Prints out the CPAN configuration in raw Perl format. Useful for debugging. +=item B<--shell> + +Starts a CPAN shell using the configuration of F. + =item B<--help> Shows this help. -- cgit v1.2.3-24-g4f1b