Message251739
I realized while answering a Stackoverflow question that the resolve method has the pieces for removing an Action from the parser. It removes an existing Action so that the new, conflicting one, can replace it.
It's meant to be used with flagged arguments. If `arg1` is an action with one option_string, it can be removed with:
parser._handle_conflict_resolve(None, [('--arg1', arg1)])
If it is a positional, this call seems to be sufficient:
arg1.container._remove_action(arg1)
http://stackoverflow.com/a/32809642/901925
Beyond answering this question I haven't tested the idea. If there's more interest I could explore it more. |
|
Date |
User |
Action |
Args |
2015-09-28 01:14:00 | paul.j3 | set | recipients:
+ paul.j3, barry, Arfrever, r.david.murray, ustinov |
2015-09-28 01:14:00 | paul.j3 | set | messageid: <1443402840.2.0.353991821351.issue19462@psf.upfronthosting.co.za> |
2015-09-28 01:14:00 | paul.j3 | link | issue19462 messages |
2015-09-28 01:13:59 | paul.j3 | create | |
|