mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-14 11:54:53 +03:00
Shell: Add a builtin that parses its sole argument and dumps its AST
Pretty useful for debugging.
This commit is contained in:
parent
39af1f8519
commit
cd6e5c064b
Notes:
sideshowbarker
2024-07-18 23:04:02 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/cd6e5c064ba Pull-request: https://github.com/SerenityOS/serenity/pull/4996
@ -40,6 +40,15 @@ extern char** environ;
|
||||
|
||||
namespace Shell {
|
||||
|
||||
int Shell::builtin_dump(int argc, const char** argv)
|
||||
{
|
||||
if (argc != 2)
|
||||
return 1;
|
||||
|
||||
Parser { argv[1] }.parse()->dump(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Shell::builtin_alias(int argc, const char** argv)
|
||||
{
|
||||
Vector<const char*> arguments;
|
||||
|
@ -63,7 +63,8 @@
|
||||
__ENUMERATE_SHELL_BUILTIN(disown) \
|
||||
__ENUMERATE_SHELL_BUILTIN(fg) \
|
||||
__ENUMERATE_SHELL_BUILTIN(bg) \
|
||||
__ENUMERATE_SHELL_BUILTIN(wait)
|
||||
__ENUMERATE_SHELL_BUILTIN(wait) \
|
||||
__ENUMERATE_SHELL_BUILTIN(dump)
|
||||
|
||||
#define ENUMERATE_SHELL_OPTIONS() \
|
||||
__ENUMERATE_SHELL_OPTION(inline_exec_keep_empty_segments, false, "Keep empty segments in inline execute $(...)") \
|
||||
|
Loading…
Reference in New Issue
Block a user