optparse: add trailing text in help message?
Steven Bethard
steven.bethard at gmail.com
Sat Oct 14 20:38:30 EDT 2006
Duncan Booth wrote:
>>>> from optparse import OptionParser
>>>> usage = "usage: %prog [options] arg1 arg2"
>>>> epilog = "that's all folks!"
>>>> parser = OptionParser(usage=usage, epilog=epilog)
>>>> parser.parse_args(['', '--help'])
> Usage: [options] arg1 arg2
>
> Options:
> -h, --help show this help message and exit
>
> that's all folks!
Very cool. Thanks! I'll update argparse to share this API.
STeVe
More information about the Python-list
mailing list