package Pod::Usage;
use vars qw($VERSION);
-$VERSION = 1.11; ## Current version of this package
-require 5.004; ## requires this Perl version or later
+$VERSION = 1.14; ## Current version of this package
+require 5.005; ## requires this Perl version or later
=head1 NAME
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 *
as a list) it should contain one or more elements with the following
keys:
-=over
+=over 4
=item C<-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>
status, verbose level, and output stream to use are determined as
follows:
-=over
+=over 4
=item *
"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 *
use strict;
#use diagnostics;
use Carp;
+use Config;
use Exporter;
use File::Spec;
}
## 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');
}
##---------------------------------------------------------------------------