classification
Title: Improve argparse usage/help customization
Type: enhancement Stage: needs patch
Components: Library (Lib) Versions: Python 3.3
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, bethard, petri.lehtinen
Priority: normal Keywords:

Created on 2011-03-27 14:05 by bethard, last changed 2012-01-16 22:01 by berker.peksag.

Messages (1)
msg132322 - (view) Author: Steven Bethard (bethard) * (Python committer) Date: 2011-03-27 14:05
I'm going to try to merge several closely related issues here. Basically, people would like better control over the usage message formatting so that you could:

* Put program name and version information at the top of the message
* Customize the "usage:" string (e.g. capitalize it)

One proposal from anatoly techtonik would be to allow a format string so that you could write something like

"""My Program, version 3.5
Usage: %(usage)s

Some description of my program

%(argument_groups)%

My epliog text
"""

This should be implemented as a HelpFormatter class, but we might have to expose a little more of the HelpFormatter API (which is currently documented as a no-public API) to make this possible.

Patches welcome. ;-)
History
Date User Action Args
2012-01-16 22:01:45berker.peksagsetnosy: + berker.peksag
2011-06-21 12:23:59petri.lehtinensetnosy: + petri.lehtinen
2011-03-27 14:23:07bethardlinkissue9653 superseder
2011-03-27 14:09:31bethardlinkissue9652 superseder
2011-03-27 14:07:05bethardlinkissue7284 superseder
2011-03-27 14:05:43bethardcreate