summaryrefslogtreecommitdiff
path: root/examples/tab_autocompletion.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-02-23 13:38:56 -0500
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-02-23 13:38:56 -0500
commit9726e982d6c81619e9355db2d495e9dd1a01578d (patch)
treedb91a3ba71bbb483c1dac16d7859cb76ce7ba582 /examples/tab_autocompletion.py
parent7b1b8b10e35b57a813369c9b23876d3615213026 (diff)
downloadcmd2-git-9726e982d6c81619e9355db2d495e9dd1a01578d.tar.gz
Made cmd2_app a positional and required argument of AutoCompleter.
Deleted bash tab completion support. AutoCompleter no longer assumes CompletionItem results are sorted.
Diffstat (limited to 'examples/tab_autocompletion.py')
-rwxr-xr-xexamples/tab_autocompletion.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/tab_autocompletion.py b/examples/tab_autocompletion.py
index 6dc9844d..156c2d45 100755
--- a/examples/tab_autocompletion.py
+++ b/examples/tab_autocompletion.py
@@ -378,7 +378,9 @@ class TabCompleteExample(cmd2.Cmd):
'director': TabCompleteExample.static_list_directors, # static list
'movie_file': (self.path_complete,)
}
- completer = argparse_completer.AutoCompleter(TabCompleteExample.media_parser, arg_choices=choices, cmd2_app=self)
+ completer = argparse_completer.AutoCompleter(TabCompleteExample.media_parser,
+ self,
+ arg_choices=choices)
tokens, _ = self.tokens_for_completion(line, begidx, endidx)
results = completer.complete_command(tokens, text, line, begidx, endidx)
@@ -525,6 +527,7 @@ class TabCompleteExample(cmd2.Cmd):
library_subcommand_groups = {'type': library_type_params}
completer = argparse_completer.AutoCompleter(TabCompleteExample.library_parser,
+ self,
subcmd_args_lookup=library_subcommand_groups)
tokens, _ = self.tokens_for_completion(line, begidx, endidx)