Subparsers
Tap now supports [subparsers](https://docs.python.org/3.8/library/argparse.html#argparse.ArgumentParser.add_subparsers).
To add a subparser, override the `configure` method and call `self.add_subparser`. Optionally, to specify keyword arguments (e.g., `help`) to the subparser collection, call `self.add_subparsers`. For example,
python
class SubparserA(Tap):
bar: int bar help
class SubparserB(Tap):
baz: Literal['X', 'Y', 'Z'] baz help
class Args(Tap):
foo: bool = False foo help
def configure(self):
self.add_subparsers(help='sub-command help')
self.add_subparser('a', SubparserA, help='a help')
self.add_subparser('b', SubparserB, help='b help')
Configure
Tap has a new method called `configure` which is called at the end of initialization. Two uses of `configure` are `add_argument` (previously called in `add_arguments`, which has now been deprecated) and `add_subparser`. For example,
python
class SubparserA(Tap):
bar: int
class Args(Tap):
foo: bool = False
def configure(self):
self.add_argument('--foo', '-f')
self.add_subparser('a', SubparserA)