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. --- cmd2/cmd2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd2/cmd2.py') diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index bc6691f6..103508c5 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -2685,7 +2685,7 @@ class Cmd(cmd.Cmd): def do_alias(self, args: argparse.Namespace) -> None: """Manage aliases""" # Call handler for whatever subcommand was selected - handler = args.get_handler() + handler = args.cmd2_handler.get() handler(args) # alias -> create @@ -2812,7 +2812,7 @@ class Cmd(cmd.Cmd): def do_macro(self, args: argparse.Namespace) -> None: """Manage macros""" # Call handler for whatever subcommand was selected - handler = args.get_handler() + handler = args.cmd2_handler.get() handler(args) # macro -> create -- cgit v1.2.1