diff options
author | Abigail <abigail@abigail.be> | 2000-08-30 23:41:18 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-31 13:38:48 +0000 |
commit | 844b31e386007943a55bfbcb085cdb20679e4a07 (patch) | |
tree | a41bb8ed36a5d7d4c7b57e81dfac0b1ae58c5008 | |
parent | 1307044d1712ffdf799e228d9d670bbf155291ad (diff) | |
download | perl-844b31e386007943a55bfbcb085cdb20679e4a07.tar.gz |
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
-rw-r--r-- | lib/Pod/Man.pm | 18 |
1 files changed, 17 insertions, 1 deletions
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<EE<lt>%sE<gt>> was printed verbatim in the output. (W) The POD source contained a non-standard interior sequence (something of the form C<XE<lt>E<gt>>) 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 |