How do I format positional argument help using Python's optparse?
Posted
by cdleary
on Stack Overflow
See other posts from Stack Overflow
or by cdleary
Published on 2009-03-13T13:16:56Z
Indexed on
2010/04/24
17:23 UTC
Read the original article
Hit count: 323
As mentioned in the docs the optparse.OptionParser
uses an IndentedHelpFormatter
to output the formatted option help, for which which I found some API documentation.
I want to display a similarly formatted help text for the required, positional arguments in the usage text. Is there an adapter or a simple usage pattern that can be used for similar positional argument formatting?
Clarification
Preferably only using the stdlib. Optparse does great except for this one formatting nuance, which I feel like we should be able to fix without importing whole other packages. :-)
© Stack Overflow or respective owner