Message131439
For kicks, I just took a look at this old, forgotten issue. I agree with the submitter that add_argument() should fail if nargs and metavar do not match, instead of having format_help() raise the exception later on.
I've attached a patch (issue9348_patch_v01.txt) with a proposed fix and associated test cases. The drawback of my approach is that if a custom HelpFormatter is used which has different semantics for metavar it could cause add_argument() to incorrectly reject the metavar value. I'm not sure how common that is though. |
|
Date |
User |
Action |
Args |
2011-03-19 19:08:59 | denversc | set | recipients:
+ denversc, bethard, catherine |
2011-03-19 19:08:59 | denversc | set | messageid: <1300561739.36.0.858826272155.issue9348@psf.upfronthosting.co.za> |
2011-03-19 19:08:58 | denversc | link | issue9348 messages |
2011-03-19 19:08:58 | denversc | create | |
|