Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.86k stars 528 forks source link

perldoc -f, -q ignores extra arguments with no notice #7469

Closed p5pRT closed 18 years ago

p5pRT commented 19 years ago

Migrated from rt.perl.org#31227 (status was 'resolved')

Searchable as RT31227$

p5pRT commented 19 years ago

From @jidanni

Gentlemen\, would you look at that. Perldoc is ignoring additional arguments without any qualms​: $ perldoc -f no-op noop No documentation for perl function `no-op' found $ perldoc -q no-op noop No documentation for perl FAQ keyword `no-op' found

However it is acceptable here​:

$ perldoc perldoc perlop Perldoc is only really meant for reading one document at a time. So these parameters are being ignored​: /usr/share/perl/5.8/pod/perlop.pod

p5pRT commented 19 years ago

From rmb1@cise.npl.co.uk

[jidanni@​jidanni.org - Wed Aug 18 15​:59​:12 2004]​:

Gentlemen\, would you look at that. Perldoc is ignoring additional arguments without any qualms​: $ perldoc -f no-op noop No documentation for perl function `no-op' found $ perldoc -q no-op noop No documentation for perl FAQ keyword `no-op' found

However it is acceptable here​:

$ perldoc perldoc perlop Perldoc is only really meant for reading one document at a time. So these parameters are being ignored​: /usr/share/perl/5.8/pod/perlop.pod

Attached is patch for this behaviour.

Robin

p5pRT commented 19 years ago

From rmb1@cise.npl.co.uk

Inline Patch ```diff --- lib/Pod/Perldoc.pm.orig Wed Jun 23 16:18:22 2004 +++ lib/Pod/Perldoc.pm Mon Sep 20 19:03:37 2004 @@ -668,6 +668,16 @@ # 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; } @@ -915,7 +925,7 @@ 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] ), ```
p5pRT commented 19 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 19 years ago

From @smpeters

[jidanni@​jidanni.org - Wed Aug 18 15​:59​:12 2004]​:

Gentlemen\, would you look at that. Perldoc is ignoring additional arguments without any qualms​: $ perldoc -f no-op noop No documentation for perl function `no-op' found $ perldoc -q no-op noop No documentation for perl FAQ keyword `no-op' found

However it is acceptable here​:

$ perldoc perldoc perlop Perldoc is only really meant for reading one document at a time. So these parameters are being ignored​: /usr/share/perl/5.8/pod/perlop.pod

$ perldoc -h perldoc [options] PageName|ModuleName|ProgramName... perldoc [options] -f BuiltinFunction perldoc [options] -q FAQRegex

Typically\, if more than one input parameter can be used\, "..." is used to show that this is allowed. This is not the case with perldoc -f or -x. Adding code to trap something that is undocumented seems like overkill to me.

p5pRT commented 19 years ago

@smpeters - Status changed from 'open' to 'rejected'

p5pRT commented 19 years ago

From @schwern

On Fri\, Oct 22\, 2004 at 06​:00​:40PM -0000\, Steve Peters via RT wrote​:

$ perldoc -h perldoc [options] PageName|ModuleName|ProgramName... perldoc [options] -f BuiltinFunction perldoc [options] -q FAQRegex

Typically\, if more than one input parameter can be used\, "..." is used to show that this is allowed. This is not the case with perldoc -f or -x. Adding code to trap something that is undocumented seems like overkill to me.

Garbage in\, garbage out. Bad. Garbage in\, nothing out. Less bad. Garbage in\, error out. Good.

perldoc -f should check its arguments.

-- Michael G Schwern schwern@​pobox.com http​://www.pobox.com/~schwern/ Cottleston\, Cottleston\, Cottleston Pie. Why does a chicken\, I don't know why. Ask me a riddle and I reply​: "Cottleston\, Cottleston\, Cottleston Pie."

p5pRT commented 19 years ago

@smpeters - Status changed from 'rejected' to 'open'

p5pRT commented 19 years ago

From Robin.Barker@npl.co.uk

I supplied a patch for this (on rt.perl.org). I suggest it should go in 5.8.6

Robin

-----Original Message----- From​: Michael G Schwern [mailto​:schwern@​pobox.com] Sent​: 22 October 2004 19​:35 To​: Steve Peters via RT Cc​: perl5-porters@​perl.org Subject​: Re​: [perl #31227] perldoc -f\, -q ignores extra arguments with no notice

On Fri\, Oct 22\, 2004 at 06​:00​:40PM -0000\, Steve Peters via RT wrote​:

$ perldoc -h perldoc [options] PageName|ModuleName|ProgramName... perldoc [options] -f BuiltinFunction perldoc [options] -q FAQRegex

Typically\, if more than one input parameter can be used\, "..." is used to show that this is allowed. This is not the case with perldoc -f or -x. Adding code to trap something that is undocumented seems like overkill to me.

Garbage in\, garbage out. Bad. Garbage in\, nothing out. Less bad. Garbage in\, error out. Good.

perldoc -f should check its arguments.

-- Michael G Schwern schwern@​pobox.com http​://www.pobox.com/~schwern/ Cottleston\, Cottleston\, Cottleston Pie. Why does a chicken\, I don't know why. Ask me a riddle and I reply​: "Cottleston\, Cottleston\, Cottleston Pie."


This e-mail and any attachments may contain confidential and/or privileged material; it is for the intended addressee(s) only. If you are not a named addressee\, you must not use\, retain or disclose such information.

NPL Management Ltd cannot guarantee that the e-mail or any attachments are free from viruses.

NPL Management Ltd. Registered in England and Wales. No​: 2937881 Registered Office​: Teddington\, Middlesex\, United Kingdom TW11 0LW.


p5pRT commented 19 years ago

From @smpeters

[jidanni@​jidanni.org - Wed Aug 18 15​:59​:12 2004]​:

Gentlemen\, would you look at that. Perldoc is ignoring additional arguments without any qualms​: $ perldoc -f no-op noop No documentation for perl function `no-op' found $ perldoc -q no-op noop No documentation for perl FAQ keyword `no-op' found

However it is acceptable here​:

$ perldoc perldoc perlop Perldoc is only really meant for reading one document at a time. So these parameters are being ignored​: /usr/share/perl/5.8/pod/perlop.pod

The patch has been provided to the Pod-Perldoc rt.cpan.org queue at https://rt.cpan.org/ NoAuth/Bug.html?id=11310

p5pRT commented 18 years ago

From @smpeters

[rmb1 - Mon Sep 20 11​:57​:47 2004]​:

[jidanni@​jidanni.org - Wed Aug 18 15​:59​:12 2004]​:

Gentlemen\, would you look at that. Perldoc is ignoring additional arguments without any qualms​: $ perldoc -f no-op noop No documentation for perl function `no-op' found $ perldoc -q no-op noop No documentation for perl FAQ keyword `no-op' found

However it is acceptable here​:

$ perldoc perldoc perlop Perldoc is only really meant for reading one document at a time. So these parameters are being ignored​: /usr/share/perl/5.8/pod/perlop.pod

Attached is patch for this behaviour.

Robin

The attached patch was applied as change #27878.

p5pRT commented 18 years ago

@smpeters - Status changed from 'open' to 'resolved'