1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

js: Port to LibMain :^)

This wasn't particularly difficult, and there's not much use for the
nicer interface yet either. While unveil() is of limited use in js(1)
as it should be able to open arbitrary files, I feel like we should be
able to add a pledge() call.
This commit is contained in:
Linus Groh 2021-11-22 19:25:30 +00:00 committed by Andreas Kling
parent ba0f89a4d1
commit cfecfbb214
3 changed files with 5 additions and 4 deletions

View file

@ -60,6 +60,7 @@
#include <LibJS/Runtime/TypedArray.h>
#include <LibJS/Runtime/Value.h>
#include <LibLine/Editor.h>
#include <LibMain/Main.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
@ -1102,7 +1103,7 @@ public:
}
};
int main(int argc, char** argv)
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
bool gc_on_every_allocation = false;
bool disable_syntax_highlight = false;
@ -1123,7 +1124,7 @@ int main(int argc, char** argv)
#endif
args_parser.add_option(disable_syntax_highlight, "Disable live syntax highlighting", "no-syntax-highlight", 's');
args_parser.add_positional_argument(script_paths, "Path to script files", "scripts", Core::ArgsParser::Required::No);
args_parser.parse(argc, argv);
args_parser.parse(arguments.argc, arguments.argv);
bool syntax_highlight = !disable_syntax_highlight;