MCPcopy Create free account
hub / github.com/apache/mesos / __autocomplete_base__

Method __autocomplete_base__

src/python/cli_new/lib/cli/plugins/base.py:110–130  ·  view source on GitHub ↗
(self, current_word, argv)

Source from the content-addressed store, hash-verified

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 """

Callers 1

autocompleteFunction · 0.80

Calls 3

__autocomplete__Method · 0.95
listFunction · 0.50
keysMethod · 0.45

Tested by

no test coverage detected