[New-bugs-announce] [issue9355] argparse add_mutually_exclusive_group more than once has incorrectly formatted help

Steven Bethard report at bugs.python.org
Fri Jul 23 16:35:28 CEST 2010


New submission from Steven Bethard <steven.bethard at gmail.com>:

[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.

----------
components: Library (Lib)
messages: 111335
nosy: bethard
priority: normal
severity: normal
stage: needs patch
status: open
title: argparse add_mutually_exclusive_group more than once has incorrectly formatted help
type: behavior
versions: Python 2.7, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9355>
_______________________________________


More information about the New-bugs-announce mailing list