X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fpodchecker.PL;h=1fa6917b175942735cfcbff6ee51f9a306437a4f;hb=3f7c398ef4badd9c6ec5b40ea29141484c160f63;hp=20d5e94c2e0224ff6b23f9dc9efdc34e0490c1fe;hpb=22d4bb9ccb8701e68f9243547d7e3a3c55f70908;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/podchecker.PL b/pod/podchecker.PL index 20d5e94..1fa6917 100644 --- a/pod/podchecker.PL +++ b/pod/podchecker.PL @@ -114,8 +114,10 @@ L and L =head1 AUTHORS +Please report bugs using L. + Brad Appleton Ebradapp@enteract.comE, -Marek Rouchal Emarek@saftsack.fs.uni-bayreuth.deE +Marek Rouchal Emarekr@cpan.orgE Based on code for B written by Tom Christiansen Etchrist@mox.perl.comE @@ -148,23 +150,29 @@ pod2usage(2) if ((@ARGV == 0) && (-t STDIN)); ## Invoke podchecker() my $status = 0; @ARGV = qw(-) unless(@ARGV); -for (@ARGV) { - if($_ eq '-') { - $_ = "<&STDIN"; +for my $podfile (@ARGV) { + if($podfile eq '-') { + $podfile = "<&STDIN"; } - elsif(-d) { - warn "podchecker: Warning: Ignoring directory '$_'\n"; + elsif(-d $podfile) { + warn "podchecker: Warning: Ignoring directory '$podfile'\n"; next; } - my $s = podchecker($_, undef, '-warnings' => $options{warnings}); - if($s > 0) { + my $errors = podchecker($podfile, undef, '-warnings' => $options{warnings}); + if($errors > 0) { # errors occurred + printf STDERR ("%s has %d pod syntax %s.\n", + $podfile, $errors, ($errors == 1) ? "error" : "errors"); $status = 1; } - elsif($s < 0) { + elsif($errors < 0) { + print STDERR "$podfile does not contain any pod commands.\n"; # no pod found $status = 2 unless($status); } + else { + print STDERR "$podfile pod syntax OK.\n"; + } } exit $status;