Message256612
Argument groups are not designed to be nested.
If you print_help the parent parser, you'll see that the sub_args are missing entirely, not just displaced. They appear in the usage, but not the help lines. sub_group has no record that it was added to global_group (it doesn't have the ._container attribute).
All containers, both parsers and groups, have a ._action_groups list (inherited from their common super), but I don't think any of the group code uses that list. And the part of the help_formatter than handles groups is not recursive. It handles just one level of groups.
I suspect the sub_group actions appear in the 'optional arguments' group for similar reasons as with the mutually_exclusive_group, but the details probably differ.
There have been a number of questions on SO about using argument_groups to add actions to a mutually_exclusive_group. They either want a convenient way of adding a group of actions, or they want some sort of 'any' logic applied to the subgroup. We've had to say - no you can't nest groups like that. I have explored in another bug/issue the idea of nesting groups and applying all sorts of logic (not just xor), but that's a big issue. |
|
Date |
User |
Action |
Args |
2015-12-17 18:17:24 | paul.j3 | set | recipients:
+ paul.j3, balage |
2015-12-17 18:17:24 | paul.j3 | set | messageid: <1450376244.05.0.33169945397.issue25882@psf.upfronthosting.co.za> |
2015-12-17 18:17:24 | paul.j3 | link | issue25882 messages |
2015-12-17 18:17:23 | paul.j3 | create | |
|