MCPcopy Create free account
hub / github.com/apple/foundationdb / compGenerator

Function compGenerator

fdbcli/fdbcli.actor.cpp:743–766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

741}
742
743void compGenerator(const char* text, bool help, std::vector<std::string>& lc) {
744 std::map<std::string, CommandHelp>::const_iterator iter;
745 int len = strlen(text);
746
747 const char* helpExtra[] = { "escaping", "options", nullptr };
748
749 const char** he = helpExtra;
750
751 for (auto iter = helpMap.begin(); iter != helpMap.end(); ++iter) {
752 const char* name = (*iter).first.c_str();
753 if (!strncmp(name, text, len)) {
754 lc.push_back(newCompletion(help ? "help " : "", name));
755 }
756 }
757
758 if (help) {
759 while (*he) {
760 const char* name = *he;
761 he++;
762 if (!strncmp(name, text, len))
763 lc.push_back(newCompletion("help ", name));
764 }
765 }
766}
767
768void cmdGenerator(const char* text, std::vector<std::string>& lc) {
769 compGenerator(text, false, lc);

Callers 2

cmdGeneratorFunction · 0.85
helpGeneratorFunction · 0.85

Calls 5

newCompletionFunction · 0.85
beginMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected