Using python\'s optparse module I would like to add extra example lines below the regular usage output. My current help_print() output looks like this:
usage: ch
Use the usage
parameter:
usage = "usage: %prog [options] arg1 arg2"
parser = OptionParser(usage=usage)
You can add more through (just an example):
group = OptionGroup(parser, "Dangerous Options",
"Caution: use these options at your own risk. "
"It is believed that some of them bite.")
group.add_option("-g", action="store_true", help="Group option.")
parser.add_option_group(group)
Example output:
usage: [options] arg1 arg2
options: -h, --help show this help message and exit
-v, --verbose make lots of noise [default]
-q, --quiet be vewwy quiet (I'm hunting wabbits)
-fFILE, --file=FILE write output to FILE
-mMODE, --mode=MODE interaction mode: one of 'novice', 'intermediate', [default], 'expert'Dangerous Options: Caution: use of these options is at your own risk. It is believed that some of them bite. -g Group option.
Have a look here.