diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt index fb73425f0c..bc8c67a99f 100644 --- a/Userland/Utilities/CMakeLists.txt +++ b/Userland/Utilities/CMakeLists.txt @@ -154,6 +154,7 @@ target_link_libraries(pmemdump LibMain) target_link_libraries(pro LibMain LibProtocol) target_link_libraries(ps LibMain) target_link_libraries(pwd LibMain) +target_link_libraries(realpath LibMain) target_link_libraries(rev LibMain) target_link_libraries(rm LibMain) target_link_libraries(rmdir LibMain) diff --git a/Userland/Utilities/realpath.cpp b/Userland/Utilities/realpath.cpp index 0f48afb494..bd5bbb54d7 100644 --- a/Userland/Utilities/realpath.cpp +++ b/Userland/Utilities/realpath.cpp @@ -5,15 +5,14 @@ */ #include +#include +#include #include #include -int main(int argc, char** argv) +ErrorOr serenity_main(Main::Arguments arguments) { - if (pledge("stdio rpath", nullptr) < 0) { - perror("pledge"); - return 1; - } + TRY(Core::System::pledge("stdio rpath")); const char* path; @@ -21,7 +20,7 @@ int main(int argc, char** argv) args_parser.set_general_help( "Show the 'real' path of a file, by resolving all symbolic links along the way."); args_parser.add_positional_argument(path, "Path to resolve", "path"); - args_parser.parse(argc, argv); + args_parser.parse(arguments); char* value = realpath(path, nullptr); if (value == nullptr) {