Skip to content

Commit

Permalink
fixed regex for converting '?' command to 'help'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
xdg committed Sep 22, 2007
1 parent 673cd0c commit 5f5a7fb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,3 +1,6 @@
* fixed bug that kept "?" from being interpreted as "help" command
(David Golden)

2007-09-15 Andreas J. Koenig <andreas.koenig.7os6VVqR@franz.ak.mind.de>

* release 1.91_55: stable release candidate II
Expand Down
4 changes: 2 additions & 2 deletions lib/CPAN.pm
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 {
Expand Down
18 changes: 18 additions & 0 deletions t/30shell.t
Expand Up @@ -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\.)
########
Expand Down

0 comments on commit 5f5a7fb

Please sign in to comment.