Issue9355
Created on 2010-07-23 14:35 by bethard, last changed 2022-04-11 14:57 by admin. This issue is now closed.
Messages (5) |
|
|
|
|
|
|
|
msg111335 - (view) |
Author: Steven Bethard (bethard) *  |
Date: 2010-07-23 14:35 |
|
|
|
|
|
[Moved from http://code.google.com/p/argparse/issues/detail?id=78] What steps will reproduce the problem? 1. Create two mutually exclusive groups: eg agroup = subcmd_parser.add_mutually_exclusive_group() agroup.add_argument('--a1', action='store_true', help='blah') agroup.add_argument('--a2', action='store_true', help='blah') agroup.add_argument('--a3', action='store_true', help='blah') bgroup = subcmd_parser.add_mutually_exclusive_group() bgroup.add_argument('--b1', action='store_true', help='blah') bgroup.add_argument('--b2', action='store_true', help='blah') bgroup.add_argument('--b3', action='store_true', help='blah') What is the expected output? What do you see instead? Expected output (on running a help command which formats help) is: [ --a1 | --a2 |
--a3 ] [ --b1 |
--b2 |
--b3 ] You see instead: [ --a1 |
--a2 |
--a3 [ --b1 |
--b2 |
--b3 ] Note that the closing brace for the first group is missing. |
msg111987 - (view) |
Author: Drake Dowsett (ddowsett) |
Date: 2010-07-29 18:53 |
|
|
|
|
|
Problem is `inserts' dictionary is overwriting previous closing bracket, so checking for existing value and then appending if found. |
|
|
|
|
|
|
|
msg112884 - (view) |
Author: Catherine Devlin (catherine) |
Date: 2010-08-04 20:24 |
|
|
|
|
|
Unit test for Drake's patch |
|
|
|
|
|
|
|
msg112885 - (view) |
Author: Catherine Devlin (catherine) |
Date: 2010-08-04 20:26 |
|
|
|
|
|
copy of Drake's argparse.diff - same patch, just has less specific diff header info (because ``patch -p0 < argparse.diff`` failed on my machine) |
|
|
|
|
|
|
|
msg120136 - (view) |
Author: Steven Bethard (bethard) *  |
Date: 2010-11-01 16:31 |
|
|
|
|
|
Committed in r86092 (3.X) and r86093 (2.7). Thanks for the patches! |
|
|
|
|
|
|
|