1
Fork 0
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:
AnotherTest 2020-06-17 18:51:44 +04:30 committed by Andreas Kling
parent a4627f2439
commit 2915dcfcc3
4 changed files with 66 additions and 1 deletions

View file

@ -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())