From: Abigail Date: Thu, 31 Aug 2000 03:41:18 +0000 (-0400) Subject: Issue useful diagnostic on unknown pod commands. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=844b31e386007943a55bfbcb085cdb20679e4a07;p=p5sagit%2Fp5-mst-13.2.git Issue useful diagnostic on unknown pod commands. Subject: [PATCH lib/Pod/Man.pm] Re: [ID 20000830.048] Message-ID: <20000831074118.24880.qmail@foad.org> p4raw-id: //depot/perl@6940 --- diff --git a/lib/Pod/Man.pm b/lib/Pod/Man.pm index b49e184..7c71681 100644 --- a/lib/Pod/Man.pm +++ b/lib/Pod/Man.pm @@ -462,7 +462,18 @@ sub command { return if $command eq 'pod'; return if ($$self{EXCLUDE} && $command ne 'end'); $command = 'cmd_' . $command; - $self->$command (@_); + unless ($self -> can ($command)) { + my $com = substr $command => 4; + my ($file, $line) = $_ [2] -> file_line; + (my $text = $_ [0]) =~ s/\n+\z//g; + $text = " $text" if $text =~ /^\S/; + warn qq {$file: Unknown command paragraph "=$com${text}"}, + qq { on line $line.\n}; + return; + } + else { + $self->$command (@_); + } } # Called for a verbatim paragraph. Gets the paragraph, the line number, and @@ -1162,6 +1173,11 @@ know about. C%sE> was printed verbatim in the output. (W) The POD source contained a non-standard interior sequence (something of the form CE>) that Pod::Man didn't know about. It was ignored. +=item %s: Unknown command paragraph "%s" on line %d. + +(W) The POD source contained a non-standard command paragraph (something of +the form C<=command args>) that Pod::Man didn't know about. It was ignored. + =item Unmatched =back (W) Pod::Man encountered a C<=back> command that didn't correspond to an