Skip to content

Add autocomplete API to CliPrompt #18

@trustytrojan

Description

@trustytrojan
  • Allow users to provide autocomplete callback of the form std::vector<std::string> autocomplete(const std::string &input)
  • When Tab is pressed on the keyboard, and a callback has been supplied to the CliPrompt instance, call it
  • If only one string is in the returned vector, replace the current input with that string
  • If more than one, do what (ba)sh does:
    • Print newline
    • List all autocomplete options while respecting console width (which will always be 32 afaik)
    • Reprint prompt with input

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions