Message179522
+1 to the feature.
A closely-related use case is customizing the message displayed by error(), which is normally the usage string followed by the error message. I wanted to append instructions on how to invoke --help, and implemented it this way for CPython's regrtest:
http://hg.python.org/cpython/file/6ee721029fd5/Lib/test/regrtest.py#l205
Also take a look at how regrtest formats its usage string as another use case to satisfy:
http://hg.python.org/cpython/file/6ee721029fd5/Lib/test/regrtest.py#l9
It seems like many argparse customizations take the form of "override this method." Would it make sense for the API to be for customizers to override string-returning methods like make_usage() and make_error() (and that accept a dictionary)? That may give a bit more control than a format string. |
|
Date |
User |
Action |
Args |
2013-01-10 05:10:57 | chris.jerdonek | set | recipients:
+ chris.jerdonek, bethard, jcon, petri.lehtinen, berker.peksag |
2013-01-10 05:10:57 | chris.jerdonek | set | messageid: <1357794657.26.0.912841362349.issue11695@psf.upfronthosting.co.za> |
2013-01-10 05:10:57 | chris.jerdonek | link | issue11695 messages |
2013-01-10 05:10:56 | chris.jerdonek | create | |
|