summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2020-08-25 16:11:49 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2020-08-26 17:52:34 -0400
commit478ea83336a4d1659ad06ef365db3dc5e051e46d (patch)
treecbaff855e2d73f1d86ae1230f32770e31c62ad6b /cmd2/cmd2.py
parent97c348c599d8fa963553593e5c19fb100b85e313 (diff)
downloadcmd2-git-478ea83336a4d1659ad06ef365db3dc5e051e46d.tar.gz
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.
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r--cmd2/cmd2.py4
1 files changed, 2 insertions, 2 deletions
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