mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:17:35 +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:
parent
b8d1edb2a2
commit
ff857cd358
5 changed files with 162 additions and 31 deletions
|
@ -776,3 +776,16 @@ bool Shell::run_builtin(int argc, const char** argv, int& retval)
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Shell::has_builtin(const StringView& name) const
|
||||
{
|
||||
#define __ENUMERATE_SHELL_BUILTIN(builtin) \
|
||||
if (name == #builtin) { \
|
||||
return true; \
|
||||
}
|
||||
|
||||
ENUMERATE_SHELL_BUILTINS();
|
||||
|
||||
#undef __ENUMERATE_SHELL_BUILTIN
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue