mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 19:28:11 +00:00
Shell: Add the alias builtin and resolve aliases
This follows the other shells in alias resolution, and resolves the alias only once.
This commit is contained in:
parent
a4627f2439
commit
2915dcfcc3
4 changed files with 66 additions and 1 deletions
|
@ -306,6 +306,11 @@ void Shell::unset_local_variable(const String& name)
|
|||
m_local_variables.remove(name);
|
||||
}
|
||||
|
||||
String Shell::resolve_alias(const String& name) const
|
||||
{
|
||||
return m_aliases.get(name).value_or({});
|
||||
}
|
||||
|
||||
int Shell::run_command(const StringView& cmd)
|
||||
{
|
||||
if (cmd.is_empty())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue