diff options
author | Ariel Abreu <facekapow@outlook.com> | 2022-01-24 20:59:22 -0500 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2022-01-25 02:50:10 +0000 |
commit | 790274d4a5f4825431367b6b640e592260a3826e (patch) | |
tree | 9ca470a9f183a67d515d1618e030d21d7da73829 /Userland/Utilities | |
parent | 0fea2203dc9a008208933a07dae56698c66f91bd (diff) | |
download | serenity-790274d4a5f4825431367b6b640e592260a3826e.zip |
rmdir: Port to LibMain
Diffstat (limited to 'Userland/Utilities')
-rw-r--r-- | Userland/Utilities/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Userland/Utilities/rmdir.cpp | 11 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt index 6ea83dba85..69110b3aa4 100644 --- a/Userland/Utilities/CMakeLists.txt +++ b/Userland/Utilities/CMakeLists.txt @@ -150,6 +150,7 @@ target_link_libraries(ps LibMain) target_link_libraries(pwd LibMain) target_link_libraries(rev LibMain) target_link_libraries(rm LibMain) +target_link_libraries(rmdir LibMain) target_link_libraries(run-tests LibRegex) target_link_libraries(shot LibGUI) target_link_libraries(shuf LibMain) diff --git a/Userland/Utilities/rmdir.cpp b/Userland/Utilities/rmdir.cpp index f278c23e1e..bafad35fd9 100644 --- a/Userland/Utilities/rmdir.cpp +++ b/Userland/Utilities/rmdir.cpp @@ -6,21 +6,20 @@ #include <AK/Vector.h> #include <LibCore/ArgsParser.h> +#include <LibCore/System.h> +#include <LibMain/Main.h> #include <stdio.h> #include <unistd.h> -int main(int argc, char** argv) +ErrorOr<int> serenity_main(Main::Arguments arguments) { - if (pledge("stdio cpath", nullptr) < 0) { - perror("pledge"); - return 1; - } + TRY(Core::System::pledge("stdio cpath")); Vector<const char*> paths; Core::ArgsParser args_parser; args_parser.add_positional_argument(paths, "Directories to remove", "paths"); - args_parser.parse(argc, argv); + args_parser.parse(arguments); int status = 0; for (auto path : paths) { |