1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:24:57 +00:00

Utilities/ln: Port to LibMain

This patch simply ports the utility ln to LibMain :^)
This commit is contained in:
Jun Zhang 2022-01-06 17:48:49 +08:00 committed by Andreas Kling
parent 81492b3cee
commit 0ac7931545
2 changed files with 5 additions and 6 deletions

View file

@ -6,15 +6,13 @@
#include <AK/LexicalPath.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/System.h>
#include <stdio.h>
#include <unistd.h>
int main(int argc, char** argv)
ErrorOr<int> serenity_main(Main::Arguments argmuments)
{
if (pledge("stdio cpath", nullptr) < 0) {
perror("pledge");
return 1;
}
TRY(Core::System::pledge("stdio cpath"));
bool force = false;
bool symbolic = false;
@ -26,7 +24,7 @@ int main(int argc, char** argv)
args_parser.add_option(symbolic, "Create a symlink", "symbolic", 's');
args_parser.add_positional_argument(target, "Link target", "target");
args_parser.add_positional_argument(path, "Link path", "path", Core::ArgsParser::Required::No);
args_parser.parse(argc, argv);
args_parser.parse(argmuments);
String path_buffer;
if (!path) {