diff options
author | Calvin Lobo <calvinlobo@gmail.com> | 2018-02-04 18:04:01 -0500 |
---|---|---|
committer | Calvin Lobo <calvinlobo@gmail.com> | 2018-02-04 18:04:01 -0500 |
commit | 96ac169f4e407b913e0735a5c36229e0501d66dc (patch) | |
tree | d7a3d2fa1b15e50ef55f3d6e2a22e05249a509c3 /cmd2.py | |
parent | 19021e194bd89b68c0dec8cb9a1a75fd49de6fe6 (diff) | |
download | cmd2-git-96ac169f4e407b913e0735a5c36229e0501d66dc.tar.gz |
When calling a submenu command from a higher level, strip off the first argument (which enters the submenu) and pass the rest on
to the submenu
Diffstat (limited to 'cmd2.py')
-rwxr-xr-x | cmd2.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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) |