summaryrefslogtreecommitdiff
path: root/docs/features
diff options
context:
space:
mode:
Diffstat (limited to 'docs/features')
-rw-r--r--docs/features/argument_processing.rst20
-rw-r--r--docs/features/modular_commands.rst2
2 files changed, 12 insertions, 10 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.
diff --git a/docs/features/modular_commands.rst b/docs/features/modular_commands.rst
index dddd996e..4abeda2d 100644
--- a/docs/features/modular_commands.rst
+++ b/docs/features/modular_commands.rst
@@ -316,7 +316,7 @@ command and each CommandSet
@with_argparser(cut_parser)
def do_cut(self, ns: argparse.Namespace):
- handler = ns.get_handler()
+ handler = ns.cmd2_handler.get()
if handler is not None:
# Call whatever subcommand function was selected
handler(ns)