mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
0e26f2657e
The builtin is based on the behaviour of the z-shell. Namely it tries to resolve every argument one by one. When resolving (in the order below) the following results can occur: 1. The argument is a shell built-in command. Then print it. 2. The argument is an alias. In this case we print the mapped value. 3. The argument was found in the `PATH` environment variable. In this case we print the resolved absolute path and try to find more occurences in the `PATH` environment variable. 4. None of the above. If no earlier argument got resolved, we print the error `{argument} not found`. If at least one argument got resolved we exit with exit code 0, otherwise 1. By not using Core::File to resolve the executable in the environment but rather using a modified version of the code we print every matching executable of the given name. This behaviour matches up with the z-shell. The builtin has the following flags to modify the behaviour according to the users needs: - `-p --path-only`: This skips the built-in and alias checks (step 1 & 2) - `-s --follow-symlink`: This follows the symlinks of an executable to its symlink-free location. - `-w --type`: This displays the type of the found object without any additional descriptive information. |
||
---|---|---|
.. | ||
Tests | ||
AST.cpp | ||
AST.h | ||
Builtin.cpp | ||
CMakeLists.txt | ||
Execution.h | ||
Formatter.cpp | ||
Formatter.h | ||
Forward.h | ||
ImmediateFunctions.cpp | ||
Job.cpp | ||
Job.h | ||
main.cpp | ||
NodeVisitor.cpp | ||
NodeVisitor.h | ||
Parser.cpp | ||
Parser.h | ||
Shell.cpp | ||
Shell.h | ||
SyntaxHighlighter.cpp | ||
SyntaxHighlighter.h |