From: Jarkko Hietaniemi Date: Mon, 21 Aug 2000 18:28:35 +0000 (+0000) Subject: Apply some PodParser 1.18 patches; the Pod/Find.pm X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=39a52d2cf5d981eb05a120d82dd92cfdc59c5e74;p=p5sagit%2Fp5-mst-13.2.git Apply some PodParser 1.18 patches; the Pod/Find.pm patches cannot be applied since #6712 conflicts. p4raw-id: //depot/perl@6754 --- diff --git a/lib/Pod/Parser.pm b/lib/Pod/Parser.pm index 99615bc..6782519 100644 --- a/lib/Pod/Parser.pm +++ b/lib/Pod/Parser.pm @@ -10,7 +10,7 @@ package Pod::Parser; use vars qw($VERSION); -$VERSION = 1.12; ## Current version of this package +$VERSION = 1.13; ## Current version of this package require 5.005; ## requires this Perl version or later ############################################################################# @@ -782,11 +782,11 @@ sub parse_text { ## Iterate over all sequence starts text (NOTE: split with ## capturing parens keeps the delimiters) $_ = $text; - my @tokens = split /([A-Z]<(?:<+\s+)?)/; + my @tokens = split /([A-Z]<(?:<+\s)?)/; while ( @tokens ) { $_ = shift @tokens; ## Look for the beginning of a sequence - if ( /^([A-Z])(<(?:<+\s+)?)$/ ) { + if ( /^([A-Z])(<(?:<+\s)?)$/ ) { ## Push a new sequence onto the stack of those "in-progress" ($cmd, $ldelim) = ($1, $2); $seq = Pod::InteriorSequence->new( diff --git a/lib/Pod/Usage.pm b/lib/Pod/Usage.pm index 56e91fc..3886076 100644 --- a/lib/Pod/Usage.pm +++ b/lib/Pod/Usage.pm @@ -10,7 +10,7 @@ package Pod::Usage; use vars qw($VERSION); -$VERSION = 1.13; ## Current version of this package +$VERSION = 1.14; ## Current version of this package require 5.005; ## requires this Perl version or later =head1 NAME @@ -80,6 +80,9 @@ program's usage message. =item C<-exitval> The desired exit status to pass to the B function. +This should be an integer, or else the string "NOEXIT" to +indicate that control should simply be returned without +terminating the invoking process. =item C<-verbose> @@ -395,6 +398,7 @@ with re-writing this manpage. use strict; #use diagnostics; use Carp; +use Config; use Exporter; use File::Spec; @@ -497,8 +501,19 @@ sub pod2usage { } ## Now translate the pod document and then exit with the desired status - $parser->parse_from_file($opts{"-input"}, $opts{"-output"}); - exit($opts{"-exitval"}); + if ( $opts{"-verbose"} >= 2 + and !ref($opts{"-input"}) + and $opts{"-output"} == \*STDOUT ) + { + ## spit out the entire PODs. Might as well invoke perldoc + my $progpath = File::Spec->catfile($Config{bin}, "perldoc"); + system($progpath, $opts{"-input"}); + } + else { + $parser->parse_from_file($opts{"-input"}, $opts{"-output"}); + } + + exit($opts{"-exitval"}) unless (lc($opts{"-exitval"}) eq 'noexit'); } ##---------------------------------------------------------------------------