summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-09-16 15:36:39 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-09-16 15:36:39 -0400
commite6585d155810f9afb2a246a71f939e1c0d511694 (patch)
tree1d41d0c8e2cdd6a1ff50edbdf48f50a3b22892b4 /cmd2/cmd2.py
parent9a7818b5a0e22e4ee5b107f6fdcceb3d3612ffd4 (diff)
downloadcmd2-git-e6585d155810f9afb2a246a71f939e1c0d511694.tar.gz
Changed arg_tokens to a dictionary
Including tokens from parent parsers in arg_tokens when subcommands are used
Diffstat (limited to 'cmd2/cmd2.py')
-rwxr-xr-xcmd2/cmd2.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index e001e75e..2cc412a9 100755
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -2669,11 +2669,11 @@ class Cmd(cmd.Cmd):
return utils.basic_complete(text, line, begidx, endidx, strs_to_match)
def complete_help_subcommand(self, text: str, line: str, begidx: int, endidx: int,
- arg_tokens: argparse.Namespace) -> List[str]:
+ arg_tokens: Dict[str, List[str]]) -> List[str]:
"""Completes the subcommand argument of help"""
# Make sure we have a command whose subcommands we will complete
- command = arg_tokens.command[0]
+ command = arg_tokens['command'][0]
if not command:
return []
@@ -2684,7 +2684,7 @@ class Cmd(cmd.Cmd):
return []
# Combine the command and its subcommand tokens for the AutoCompleter
- tokens = [command] + arg_tokens.subcommand
+ tokens = [command] + arg_tokens['subcommand']
from .argparse_completer import AutoCompleter
completer = AutoCompleter(argparser, self)