From 844b31e386007943a55bfbcb085cdb20679e4a07 Mon Sep 17 00:00:00 2001 From: Abigail Date: Wed, 30 Aug 2000 23:41:18 -0400 Subject: 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 --- lib/Pod/Man.pm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Pod/Man.pm b/lib/Pod/Man.pm index b49e184e68..7c716817f8 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 -- cgit v1.2.1