summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/lib/Pod/Usage.pm
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2002-03-16 20:14:30 +0000
committermarkm <markm@FreeBSD.org>2002-03-16 20:14:30 +0000
commit3eac21f49bc763a6c0044b4afbc0c7ece760144f (patch)
tree4cf1274fa3ca68f7ecf6a3051e0c2243e378afc5 /contrib/perl5/lib/Pod/Usage.pm
parent259bd53c06712c4ffb0ab7e06898c19ebf221b21 (diff)
downloadFreeBSD-src-3eac21f49bc763a6c0044b4afbc0c7ece760144f.zip
FreeBSD-src-3eac21f49bc763a6c0044b4afbc0c7ece760144f.tar.gz
Vendor import Perl 5.6.1
Diffstat (limited to 'contrib/perl5/lib/Pod/Usage.pm')
-rw-r--r--contrib/perl5/lib/Pod/Usage.pm29
1 files changed, 22 insertions, 7 deletions
diff --git a/contrib/perl5/lib/Pod/Usage.pm b/contrib/perl5/lib/Pod/Usage.pm
index aa8f712..3886076 100644
--- a/contrib/perl5/lib/Pod/Usage.pm
+++ b/contrib/perl5/lib/Pod/Usage.pm
@@ -10,7 +10,7 @@
package Pod::Usage;
use vars qw($VERSION);
-$VERSION = 1.12; ## Current version of this package
+$VERSION = 1.14; ## Current version of this package
require 5.005; ## requires this Perl version or later
=head1 NAME
@@ -46,7 +46,7 @@ B<pod2usage> should be given either a single argument, or a list of
arguments corresponding to an associative array (a "hash"). When a single
argument is given, it should correspond to exactly one of the following:
-=over
+=over 4
=item *
@@ -68,7 +68,7 @@ assumed to be a hash. If a hash is supplied (either as a reference or
as a list) it should contain one or more elements with the following
keys:
-=over
+=over 4
=item C<-message>
@@ -80,6 +80,9 @@ program's usage message.
=item C<-exitval>
The desired exit status to pass to the B<exit()> 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>
@@ -129,7 +132,7 @@ Unless they are explicitly specified, the default values for the exit
status, verbose level, and output stream to use are determined as
follows:
-=over
+=over 4
=item *
@@ -159,7 +162,7 @@ Although the above may seem a bit confusing at first, it generally does
"the right thing" in most situations. This determination of the default
values to use is based upon the following typical Unix conventions:
-=over
+=over 4
=item *
@@ -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');
}
##---------------------------------------------------------------------------
OpenPOWER on IntegriCloud