Equivalent of perl's Pod::Usage?
Adam Funk
a24061 at ducksburg.com
Fri Dec 7 15:12:21 EST 2007
I'm using to using Pod::Usage in my Perl programs (a snipped example
is shown below, if you're interested) to generate a little man page
when they are called with the -h option.
Is there an equivalent in Python?
Thanks,
Adam
##########
use Pod::Usage;
getopts("ha:b:c", \%option) ;
if ($option{h}) {
pod2usage(-verbose => 2);
die("\n\n");
}
# REST OF PROGRAM HERE!
#####
=head1 Documentation
=head2 Synopsis
COMMAND OPTION(S) [FILE(S)]
=head2 Options
=over
=item -h
Get this help.
...
=back
=cut
#####
More information about the Python-list
mailing list