zenlotus / argparse

Automatically exported from code.google.com/p/argparse
Other
0 stars 0 forks source link

mutually exclusive group stops working when specified via parent parser #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
What is the expected output? What do you see instead?

I've attached test_mutually_exclusive_parent.py which shows the problem.
ArgumentParser doesn't add its parents' mutually exclusive groups to its
own m.e. group.

What version of the product are you using? On what operating system?
argparse 1.0; Linux

Please provide any additional information below.

As a workaround I add the group in each subparser individually instead of
via the single parent parser ('parents=' keyword argument).

Original issue reported on code.google.com by 4kir4...@gmail.com on 11 Sep 2009 at 4:30

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by steven.b...@gmail.com on 11 Sep 2009 at 4:40

GoogleCodeExporter commented 9 years ago
I've attached argparse-0040-add-parents-mutex-groups.patch which fixes the 
problem.

Steven, is there a more correct way to fix it? 

If my understanding of argparse is not too far of the track I could add some 
tests of
mutex groups added via parents for the next bug-fix release.

Original comment by 4kir4...@gmail.com on 12 Sep 2009 at 12:47

Attachments:

GoogleCodeExporter commented 9 years ago
That looks like about the right way to fix it to me. I've committed a variant 
of your
patch along with a test in r45.

Original comment by steven.b...@gmail.com on 12 Sep 2009 at 3:57

GoogleCodeExporter commented 9 years ago
I've added some tests on top of r47 version.
The attached argparse-0047-mutex-tests.patch adds to test/test_argparse.py 
tests for
mutex groups.

Original comment by 4kir4...@gmail.com on 12 Sep 2009 at 4:38

Attachments:

GoogleCodeExporter commented 9 years ago
Great, thank you for the extra tests! Added in r49.

Original comment by steven.b...@gmail.com on 12 Sep 2009 at 5:37