Is there a way to make Python's optparse print the default value of an option or flag when showing the help with --help?
Try using the %default
string placeholder:
# This example taken from http://docs.python.org/library/optparse.html#generating-help parser.add_option("-m", "--mode", default="intermediate", help="interaction mode: novice, intermediate, " "or expert [default: %default]")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With