| 741 | } |
| 742 | |
| 743 | void 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 | |
| 768 | void cmdGenerator(const char* text, std::vector<std::string>& lc) { |
| 769 | compGenerator(text, false, lc); |
no test coverage detected