Description
ArgumentBlock typed arguments used with with_annotated do not work well with argument groups.
@dataclass
class Block(ArgumentBlock):
A: ...
B: ...
class App(Cmd):
@with_annotated(groups=(Group("Block", ...), ...))
def do_with_block(self, block_argument: Block) -> None:
...
Expected Behavior
The argument group should be created, and all arguments defined in Block should be listed in it (see the help message).
Actual Behavior
An argument group is created, but it does not list any arguments. Defining Group("A", "B", ...) is rejected and causes an error.
Possible Solution
I see at least three possible approaches:
- List all arguments defined in the
ArgumentBlock in the corresponding argument groups when using the block to create the group.
- Allow arguments defined in the
ArgumentBlock to be referenced when defining argument groups.
- Add syntax to define default argument groups inside the
ArgumentBlock.
Description
ArgumentBlocktyped arguments used withwith_annotateddo not work well with argument groups.Expected Behavior
The argument group should be created, and all arguments defined in
Blockshould be listed in it (see the help message).Actual Behavior
An argument group is created, but it does not list any arguments. Defining
Group("A", "B", ...)is rejected and causes an error.Possible Solution
I see at least three possible approaches:
ArgumentBlockin the corresponding argument groups when using the block to create the group.ArgumentBlockto be referenced when defining argument groups.ArgumentBlock.