MCPcopy Create free account
hub / github.com/daniele77/cli / GetCompletionRecursive

Method GetCompletionRecursive

include/cli/cli.h:269–274  ·  view source on GitHub ↗

Returns the collection of completions relatives to this command. For simple commands, provides a base implementation that use the name of the command for aggregate commands (i.e., Menu), the function is redefined to give the menu command and the subcommand recursively

Source from the content-addressed store, hash-verified

267 // for aggregate commands (i.e., Menu), the function is redefined to give the menu command
268 // and the subcommand recursively
269 virtual std::vector<std::string> GetCompletionRecursive(const std::string& line) const
270 {
271 if (!enabled) return {};
272 if (name.rfind(line, 0) == 0) return {name}; // name starts_with line
273 return {};
274 }
275 protected:
276 const std::string& Name() const { return name; }
277 bool IsEnabled() const { return enabled; }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected