(self, current_word, argv)
| 108 | return ("default", []) |
| 109 | |
| 110 | def __autocomplete_base__(self, current_word, argv): |
| 111 | option = "default" |
| 112 | |
| 113 | # <command> |
| 114 | comp_words = list(self.COMMANDS.keys()) |
| 115 | comp_words = cli.util.completions(comp_words, current_word, argv) |
| 116 | if comp_words is not None: |
| 117 | return (option, comp_words) |
| 118 | |
| 119 | # <args>... |
| 120 | comp_words = self.__autocomplete__(argv[0], current_word, argv[1:]) |
| 121 | |
| 122 | # In general, we expect a tuple to be returned from __autocomplete__, |
| 123 | # with the first element being a valid autocomplete option, and the |
| 124 | # second being a list of completion words. However, in the common |
| 125 | # case we usually use the default option, so it's OK for a plugin to |
| 126 | # just return a list. We will add the "default" option for them. |
| 127 | if isinstance(comp_words, tuple): |
| 128 | option, comp_words = comp_words |
| 129 | |
| 130 | return (option, comp_words) |
| 131 | |
| 132 | def main(self, argv): |
| 133 | """ |
no test coverage detected