* 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 "..". *
| 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 | { |
no outgoing calls
no test coverage detected