MCPcopy Create free account
hub / github.com/Icinga/icinga2 / GetFieldCompletionSuggestions

Method GetFieldCompletionSuggestions

lib/cli/featureutility.cpp:26–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26std::vector<String> FeatureUtility::GetFieldCompletionSuggestions(const String& word, bool enable)
27{
28 std::vector<String> cache;
29 std::vector<String> suggestions;
30
31 GetFeatures(cache, enable);
32
33 std::sort(cache.begin(), cache.end());
34
35 for (const String& suggestion : cache) {
36 if (suggestion.Find(word) == 0)
37 suggestions.push_back(suggestion);
38 }
39
40 return suggestions;
41}
42
43int FeatureUtility::EnableFeatures(const std::vector<std::string>& features)
44{

Callers

nothing calls this directly

Calls 4

FindMethod · 0.80
push_backMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected