From: Steve Peters Date: Mon, 17 Apr 2006 20:05:03 +0000 (+0000) Subject: Patch to fix RT #31227: perldoc -f, -q ignores extra arguments with no notice. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=31baf5297e0129098b9ab335f013764fbb793d21;p=p5sagit%2Fp5-mst-13.2.git Patch to fix RT #31227: perldoc -f, -q ignores extra arguments with no notice. Never made it to the mailing list though, so, was never found. Patch previously provided to the Pod-Perldoc CPAN RT queue. p4raw-id: //depot/perl@27878 --- diff --git a/lib/Pod/Perldoc.pm b/lib/Pod/Perldoc.pm index 6105e1d..f64e243 100644 --- a/lib/Pod/Perldoc.pm +++ b/lib/Pod/Perldoc.pm @@ -676,6 +676,16 @@ sub options_sanity { # Any sanity-checking need doing here? + # But does not make sense to set either -f or -q in $ENV{"PERLDOC"} + if( $self->opt_f or $self->opt_q ) { + $self->usage("Only one of -f -or -q") if $self->opt_f and $self->opt_q; + warn + "Perldoc is only really meant for reading one word at a time.\n", + "So these parameters are being ignored: ", + join(' ', @{$self->{'args'}}), + "\n" + if @{$self->{'args'}} + } return; } @@ -929,7 +939,7 @@ sub render_findings { die "Nothing found?!"; # should have been caught before here } elsif(@$found_things > 1) { - warn join '', + warn "Perldoc is only really meant for reading one document at a time.\n", "So these parameters are being ignored: ", join(' ', @$found_things[1 .. $#$found_things] ),