diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-02-23 13:38:56 -0500 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-02-23 13:38:56 -0500 |
commit | 9726e982d6c81619e9355db2d495e9dd1a01578d (patch) | |
tree | db91a3ba71bbb483c1dac16d7859cb76ce7ba582 /examples/tab_autocompletion.py | |
parent | 7b1b8b10e35b57a813369c9b23876d3615213026 (diff) | |
download | cmd2-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-x | examples/tab_autocompletion.py | 5 |
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) |