summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd2.py b/cmd2.py
index e7787c8e..a237e1bd 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -672,8 +672,9 @@ class AddSubmenu(object):
for sub_attr, par_attr in self.shared_attributes.items():
setattr(submenu, sub_attr, getattr(parent_cmd, par_attr))
- if line:
- # Execute the command
+ if line.parsed.args:
+ # Remove the menu argument and execute the command in the submenu
+ line = submenu.parser_manager.parsed(line.parsed.args)
submenu.precmd(line)
ret = submenu.onecmd(line)
submenu.postcmd(ret, line)