mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +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
Notes:
sideshowbarker
2024-07-19 05:09:39 +09:00
Author: https://github.com/alimpfard
Commit: 2915dcfcc3
Pull-request: https://github.com/SerenityOS/serenity/pull/2542
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/bugaevc
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