From 5f5a7fbc9e64190d31c44e8c938f5c799a1913f1 Mon Sep 17 00:00:00 2001 From: David Golden Date: Sat, 22 Sep 2007 20:48:42 +0000 Subject: [PATCH] fixed regex for converting '?' command to 'help' added 30shell.t tests for help, h, and ? both with and without args fixed typo on message for connecting to internet git-svn-id: https://pause.perl.org:5460/svn/cpanpm/trunk@2254 81f69c26-07c4-0310-b1c3-f486c8728884 --- Changes | 3 +++ lib/CPAN.pm | 4 ++-- t/30shell.t | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index e8ff36e56..f8d51f08f 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ + * fixed bug that kept "?" from being interpreted as "help" command + (David Golden) + 2007-09-15 Andreas J. Koenig * release 1.91_55: stable release candidate II diff --git a/lib/CPAN.pm b/lib/CPAN.pm index c9813f8b0..f0323f890 100644 --- a/lib/CPAN.pm +++ b/lib/CPAN.pm @@ -242,7 +242,7 @@ ReadLine support %s $_ = "$continuation$_" if $continuation; s/^\s+//; next SHELLCOMMAND if /^$/; - s/^\s*\?\s+/help /; + s/^\s*\?\s*/help /; if (/^(?:q(?:uit)?|bye|exit)$/i) { last SHELLCOMMAND; } elsif (s/\\$//s) { @@ -4005,7 +4005,7 @@ I would like to connect to one of the following sites to get '%s': $file, join("",map { " ".$_->text."\n" } @CPAN::Defaultsites), ); - my $answer = CPAN::Shell::colorable_makemaker_prompt("Is it OK to try to connect to the iternet?", "yes"); + my $answer = CPAN::Shell::colorable_makemaker_prompt("Is it OK to try to connect to the Internet?", "yes"); if ($answer =~ /^y/i) { $connect_to_internet_ok = 1; } else { diff --git a/t/30shell.t b/t/30shell.t index 06a56438f..f04f42196 100644 --- a/t/30shell.t +++ b/t/30shell.t @@ -1093,6 +1093,24 @@ __END__ #E:inhibit_startup_message #R:Term::ReadLine::Perl||Term::ReadLine::Gnu ######## +#P:help +#E:Display Information +######## +#P:h +#E:Display Information +######## +#P:? +#E:Display Information +######## +#P:help foo +#E:foo: No help available +######## +#P:h foo +#E:foo: No help available +######## +#P:? foo +#E:foo: No help available +######## #P:quit #E:(removed\.) ########