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

Method GetCompletionWithParent

include/cli/cli.h:594–607  ·  view source on GitHub ↗

* Retrieves completion suggestions for the user input recursively, including the parent command. * * This function is similar to `GetCompletionRecursive` but explicitly includes * completions from the parent command (if available) using its `GetCompletionRecursiveFull` function. * This allows navigation within the command hierarchy using "..". *

Source from the content-addressed store, hash-verified

592 * @return A vector containing suggested completions for the user input.
593 */
594 std::vector<std::string> GetCompletionWithParent(const std::string& line) const
595 {
596 if (line.rfind(Name(), 0) == 0) // line starts_with Name()
597 {
598 return GetCompletionRecursiveHelper(line, Name());
599 }
600
601 if (line.rfind(ParentShortcut(), 0) == 0) // line starts_with ..
602 {
603 return GetCompletionRecursiveHelper(line, ParentShortcut());
604 }
605
606 return Command::GetCompletionRecursive(line);
607 }
608
609 std::vector<std::string> GetCompletionRecursiveHelper(const std::string& line, const std::string& prefix) const
610 {

Callers 2

GetCompletionsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected