mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:24:57 +00:00
env: Convert to serenity_main(..)
This commit is contained in:
parent
81c98502f3
commit
831242f32a
2 changed files with 6 additions and 6 deletions
|
@ -6,16 +6,15 @@
|
|||
|
||||
#include <LibCore/ArgsParser.h>
|
||||
#include <LibCore/DirIterator.h>
|
||||
#include <LibCore/System.h>
|
||||
#include <LibMain/Main.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
if (pledge("stdio rpath exec", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
TRY(Core::System::pledge("stdio rpath exec"));
|
||||
|
||||
bool ignore_env = false;
|
||||
const char* split_string = nullptr;
|
||||
|
@ -28,7 +27,7 @@ int main(int argc, char** argv)
|
|||
args_parser.add_option(split_string, "Process and split S into separate arguments; used to pass multiple arguments on shebang lines", "split-string", 'S', "S");
|
||||
|
||||
args_parser.add_positional_argument(values, "Environment and commands", "env/command", Core::ArgsParser::Required::No);
|
||||
args_parser.parse(argc, argv);
|
||||
args_parser.parse(arguments);
|
||||
|
||||
if (ignore_env)
|
||||
clearenv();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue