Message294663
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. |
|
Date |
User |
Action |
Args |
2017-05-28 23:25:22 | paul.j3 | set | recipients:
+ paul.j3, r.david.murray, serhiy.storchaka, falu2010, cheryl.sabella |
2017-05-28 23:25:22 | paul.j3 | set | messageid: <1496013922.82.0.494980377133.issue29626@psf.upfronthosting.co.za> |
2017-05-28 23:25:22 | paul.j3 | link | issue29626 messages |
2017-05-28 23:25:22 | paul.j3 | create | |
|