summaryrefslogtreecommitdiff
path: root/AutoCompleter.py
diff options
context:
space:
mode:
authorEric Lin <anselor@gmail.com>2018-04-14 14:15:16 -0700
committerEric Lin <anselor@gmail.com>2018-04-14 14:15:16 -0700
commite20f7ec3850db2658053f73f5c9023868d7f12c7 (patch)
tree5a0acbd4a27f9c9b65874d2975d5b6c6ae155dc1 /AutoCompleter.py
parentf6b6a3ce05c47dec6fa7f9c8ab4fc90b9efc6306 (diff)
downloadcmd2-git-e20f7ec3850db2658053f73f5c9023868d7f12c7.tar.gz
Started working on an example for autocompleter usage.
Diffstat (limited to 'AutoCompleter.py')
-rwxr-xr-xAutoCompleter.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/AutoCompleter.py b/AutoCompleter.py
index 10274d93..753c8e63 100755
--- a/AutoCompleter.py
+++ b/AutoCompleter.py
@@ -16,7 +16,7 @@ class _RangeAction(object):
self.nargs_max = None
# pre-process special ranged nargs
- if isinstance(nargs, Tuple):
+ if isinstance(nargs, tuple):
if len(nargs) != 2 or not isinstance(nargs[0], int) or not isinstance(nargs[1], int):
raise ValueError('Ranged values for nargs must be a tuple of 2 integers')
if nargs[0] >= nargs[1]:
@@ -122,7 +122,7 @@ class AutoCompleter(object):
def __init__(self,
parser: argparse.ArgumentParser,
- token_start_index: int,
+ token_start_index: int = 1,
arg_choices: Dict[str, Union[List, Tuple, Callable]] = None,
subcmd_args_lookup: dict = None,
tab_for_arg_help: bool = True):