diff options
author | Eric Lin <anselor@gmail.com> | 2018-04-17 12:04:08 -0400 |
---|---|---|
committer | Eric Lin <anselor@gmail.com> | 2018-04-17 12:07:24 -0400 |
commit | de471a898eecdc49addf5912d6b43aa218ee85da (patch) | |
tree | d5bf2040b7f47af018ec4f45bae386cdf61b28e1 /AutoCompleter.py | |
parent | 94da51a0dd04c76cd01680926e5c020eb9932b51 (diff) | |
download | cmd2-git-de471a898eecdc49addf5912d6b43aa218ee85da.tar.gz |
Some minor tweaks to AutoCompleter handling a collection of index-based function arguments.
Added example for fully custom completion functions mixed with argparse/AutoCompleter handling
- Also demonstrates the ability to pass in a list, tuple, or dict of parameters to append to the custom completion function.
Added new test cases exercising the custom completion function calls.
Added AutoCompleter and rl_utils to the coverage report.
Diffstat (limited to 'AutoCompleter.py')
-rwxr-xr-x | AutoCompleter.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/AutoCompleter.py b/AutoCompleter.py index f188a46e..dea47e67 100755 --- a/AutoCompleter.py +++ b/AutoCompleter.py @@ -429,7 +429,7 @@ class AutoCompleter(object): list_args = None kw_args = None for index in range(1, len(arg_choices)): - if isinstance(arg_choices[index], list): + if isinstance(arg_choices[index], list) or isinstance(arg_choices[index], tuple): list_args = arg_choices[index] elif isinstance(arg_choices[index], dict): kw_args = arg_choices[index] |