[Canberra-pm] Still podding around
Paul Matthews
plm at netspace.net.au
Wed Aug 6 00:24:05 PDT 2008
If my reading of Pod::Usage is correct, this should work. If called with
./podme --manual it print the manual out as expected. If called with
./podme --help it does nothing. If called with ./podme --foo then at
work it does nothing, at home it produces the correct result. Clue
required please.
#!/usr/bin/perl -w
use Getopt::Long;
use Pod::Usage;
use strict;
my $help;
my $manual;
GetOptions( 'help' => \$help,
'manual' => \$manual ) || pod2usage(2);
pod2usage( -verbose => 1 ) if( $help );
pod2usage( -verbose => 2 ) if( $manual );
=head1 NAME
program - a program
=head1 SYNOPSIS
program ( --help | -- manual )
=head1 DESCRIPTION
Prints either short help, or long help.
=head1 OPTIONS
=over
=item B<--help>
Print a brief help message and exits.
=item B<--manual>
Prints the manual page and exits.
=back
=cut
--
Fools ignore complexity. Pragmatists suffer it.
Some can avoid it. Geniuses remove it.
More information about the Canberra-pm
mailing list