summaryrefslogtreecommitdiff
path: root/docs/features/argument_processing.rst
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2020-08-27 13:44:24 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2020-08-27 13:44:24 -0400
commite650fc3defd7ddeb32eeadeeddccda370539ce1d (patch)
treea4809c8dcdbc3dcf4e1af624ba0e824f0a7c2861 /docs/features/argument_processing.rst
parent5942f2105eb83140a8ab37e655e2561c4d17d3a2 (diff)
parente3a07c59b541b4a0b937c62ef38be6d8c011c0a3 (diff)
downloadcmd2-git-e650fc3defd7ddeb32eeadeeddccda370539ce1d.tar.gz
Merge branch 'master' into 2.0
Diffstat (limited to 'docs/features/argument_processing.rst')
-rw-r--r--docs/features/argument_processing.rst20
1 files changed, 11 insertions, 9 deletions
diff --git a/docs/features/argument_processing.rst b/docs/features/argument_processing.rst
index 7ce8c815..06f48f82 100644
--- a/docs/features/argument_processing.rst
+++ b/docs/features/argument_processing.rst
@@ -13,9 +13,8 @@ handles the following for you:
3. Passes the resulting ``argparse.Namespace`` object to your command function.
The ``Namespace`` includes the ``Statement`` object that was created when
- parsing the command line. It is stored in the ``__statement__`` attribute of
- the ``Namespace`` and can also be retrieved by calling ``get_statement()``
- on the ``Namespace``.
+ parsing the command line. It can be retrieved by calling
+ ``cmd2_statement.get()`` on the ``Namespace``.
4. Adds the usage message from the argument parser to your command.
@@ -391,10 +390,13 @@ Reserved Argument Names
Namespaces. To avoid naming collisions, do not use any of the names for your
argparse arguments.
+- ``cmd2_statement`` - ``cmd2.Cmd2AttributeWrapper`` object containing
+ ``cmd2.Statement`` object that was created when parsing the command line.
- ``__statement__`` - ``cmd2.Statement`` object that was created when parsing
- the command line.
-- ``get_statement()`` - convenience function which returns the ``Statement``
-- ``__subcmd_handler__`` - points to subcommand handler function. This is added
- when using the ``@cmd2.as_subcommand_to`` decorator.
-- ``get_handler()`` - convenience function which returns the subcommand handler
- or ``None`` if one was not set
+ the command line. (This is deprecated and will be removed in 2.0.0.) Use
+ ``cmd2_statement`` instead.
+
+- ``__subcmd_handler__`` - used by cmd2 to identify the handler for a
+ subcommand created with ``@cmd2.as_subcommand_to`` decorator.
+- ``cmd2_handler`` - ``cmd2.Cmd2AttributeWrapper`` object containing
+ a subcommand handler function or ``None`` if one was not set.