1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:18:12 +00:00

Shell: Initial support for 'option' completions

Take one small step towards #2357.
Handle completing barewords starting with '-' by piping the requests to
the Shell::complete_option(program_name, option) :^)

Also implements completion for a single builtin (setopt) until we figure out how
to handle #2357.
This commit is contained in:
AnotherTest 2020-06-29 06:26:06 +04:30 committed by Andreas Kling
parent b8d1edb2a2
commit ff857cd358
5 changed files with 162 additions and 31 deletions

View file

@ -75,6 +75,7 @@ public:
RefPtr<Job> run_command(AST::Command&);
bool run_file(const String&);
bool run_builtin(int argc, const char** argv, int& retval);
bool has_builtin(const StringView&) const;
void block_on_job(RefPtr<Job>);
String prompt() const;
@ -101,6 +102,7 @@ public:
Vector<Line::CompletionSuggestion> complete_program_name(const String&, size_t offset);
Vector<Line::CompletionSuggestion> complete_variable(const String&, size_t offset);
Vector<Line::CompletionSuggestion> complete_user(const String&, size_t offset);
Vector<Line::CompletionSuggestion> complete_option(const String&, const String&, size_t offset);
void take_back_stdin();