This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author paul.j3
Recipients cheryl.sabella, falu2010, paul.j3, r.david.murray, serhiy.storchaka
Date 2017-05-28.23:25:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1496013922.82.0.494980377133.issue29626@psf.upfronthosting.co.za>
In-reply-to
Content
I don't anticipate  any backward compatibility issues with the proposed patch.  But at the same time it feels almost too trivial of an issue to merit a patch.  

A short metavar such as `metavar="ID"' or even `metavar="_"' would be nearly as compact, and still leave an indicator of the required argument (in usage as well as the help).

I'm not even sure if disallowing a blank metavar is worth the change.

As indicated before I've only seen this extra space problem when I or others suggest the blank metavar as a way making a more compact help invocation.  That has come up frequently on SO, but I can't find a relevant bug/issue.  

https://stackoverflow.com/a/18280876/901925 - here I suggest suppressing the help line and putting custom info in the group's description.

https://stackoverflow.com/questions/9642692/argparse-help-without-duplicate-allcaps - suggests a help formatter subclass

So maybe the bigger issue is, can we make it easier to customize the the help invocation formatting?

Things to consider:

- metavar affects both the help line and usage

- setting help width and indentation is a messy part of the formatter

- there are unittests for long and long-long-longer option names to test these indentation issues.

As with some other help formatter issues, we are treading a fine line between making trivial patches, and substantive ones that make it cleaner and more robust.
History
Date User Action Args
2017-05-28 23:25:22paul.j3setrecipients: + paul.j3, r.david.murray, serhiy.storchaka, falu2010, cheryl.sabella
2017-05-28 23:25:22paul.j3setmessageid: <1496013922.82.0.494980377133.issue29626@psf.upfronthosting.co.za>
2017-05-28 23:25:22paul.j3linkissue29626 messages
2017-05-28 23:25:22paul.j3create