File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed
Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 11"""Build argparse parsers from type-annotated function signatures.
22
3+ .. warning:: Experimental
4+
5+ This module is experimental and its behaviour may change in future releases.
6+
37This module provides the :func:`with_annotated` decorator that inspects a
48command function's type hints and default values to automatically construct
59a ``Cmd2ArgumentParser``. It also provides :class:`Argument` and
Original file line number Diff line number Diff line change @@ -355,6 +355,8 @@ def with_annotated(
355355) -> Any :
356356 """Decorate a ``do_*`` method to build its argparse parser from type annotations.
357357
358+ .. warning:: Experimental -- behaviour may change in future releases.
359+
358360 :param func: the command function (when used without parentheses)
359361 :param ns_provider: optional callable returning a prepopulated argparse.Namespace
360362 :param preserve_quotes: if True, preserve quotes in arguments
Original file line number Diff line number Diff line change @@ -57,6 +57,11 @@ stores internally. A consequence is that parsers don't need to be unique across
5757
5858## with_annotated decorator
5959
60+ !!! warning "Experimental"
61+
62+ `@with_annotated` is experimental and its behaviour may change in future releases. If you
63+ encounter issues, please report them and consider using `@with_argparser` as a stable alternative.
64+
6065The [ @with_annotated] [ cmd2.decorators.with_annotated ] decorator builds an argparse parser
6166automatically from the decorated function's type annotations. No manual ` add_argument() ` calls are
6267required.
You can’t perform that action at this time.
0 commit comments