From 478ea83336a4d1659ad06ef365db3dc5e051e46d Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Tue, 25 Aug 2020 16:11:49 -0400 Subject: The functions cmd2 adds to Namespaces (get_statement() and get_handler()) are now Cmd2AttributeWrapper objects named cmd2_statement and cmd2_handler. This makes it easy to filter out which attributes in an argparse.Namespace were added by cmd2. --- examples/modular_subcommands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/modular_subcommands.py') diff --git a/examples/modular_subcommands.py b/examples/modular_subcommands.py index 44d4edd8..0b1f4ed3 100644 --- a/examples/modular_subcommands.py +++ b/examples/modular_subcommands.py @@ -98,7 +98,7 @@ class ExampleApp(cmd2.Cmd): @with_argparser(cut_parser) def do_cut(self, ns: argparse.Namespace): # Call handler for whatever subcommand was selected - handler = ns.get_handler() + handler = ns.cmd2_handler.get() if handler is not None: handler(ns) else: -- cgit v1.2.1