summaryrefslogtreecommitdiff
path: root/Userland/Shell/Shell.h
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2023-06-03 18:44:39 +0200
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2023-06-05 09:25:11 +0330
commit9531abcb1a6f55157ec31c81cec762807fd14cb4 (patch)
tree879966226e4aa1954c21be240096508f78f8deef /Userland/Shell/Shell.h
parent6e5457d9e02b30d7b7f04cf47cc694ba3431e0cc (diff)
downloadserenity-9531abcb1a6f55157ec31c81cec762807fd14cb4.zip
Shell: Add a "." builtin that aliases to "source" in POSIXmaster
This patch adds an alias to the source builtin when an user types ".". We cannot just add an enumeration entry using __ENUMERATE_SHELL_BUILTIN because "." is not a valid name in a function. This patch adds handling similarly to the name rewriting of ":". This alias is limited to POSIX mode only.
Diffstat (limited to 'Userland/Shell/Shell.h')
-rw-r--r--Userland/Shell/Shell.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Shell/Shell.h b/Userland/Shell/Shell.h
index a34a84f968..b425333183 100644
--- a/Userland/Shell/Shell.h
+++ b/Userland/Shell/Shell.h
@@ -462,7 +462,11 @@ private:
#undef __ENUMERATE_SHELL_BUILTIN
+ "."sv, // Needs to be aliased to "source" in POSIX mode.
+ // clang-format off
+ // Clang-format does not properly indent this, it gives it 4 spaces too few.
":"sv, // POSIX-y name for "noop".
+ // clang-format on
};
bool m_should_ignore_jobs_on_next_exit { false };