diff options
author | Brian Gianforcaro <bgianf@serenityos.org> | 2022-03-21 00:42:34 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-22 11:39:20 +0100 |
commit | 575fcc42c3f70ffe7401f2addc51b1491a78a4c0 (patch) | |
tree | 3edda903028e340a3e1f7e29b90394d94fa50969 /Userland | |
parent | fbceebb71782f0490661bf2723920fb97c05ad32 (diff) | |
download | serenity-575fcc42c3f70ffe7401f2addc51b1491a78a4c0.zip |
purge: Port to LibMain
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Utilities/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Userland/Utilities/purge.cpp | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt index d6e612d8a9..8b6ac85288 100644 --- a/Userland/Utilities/CMakeLists.txt +++ b/Userland/Utilities/CMakeLists.txt @@ -166,6 +166,7 @@ target_link_libraries(printf LibMain) target_link_libraries(pro LibMain LibProtocol) target_link_libraries(profile LibMain) target_link_libraries(ps LibMain) +target_link_libraries(purge LibMain) target_link_libraries(pwd LibMain) target_link_libraries(realpath LibMain) target_link_libraries(reboot LibMain) diff --git a/Userland/Utilities/purge.cpp b/Userland/Utilities/purge.cpp index fcbefd4493..b7af6d34c9 100644 --- a/Userland/Utilities/purge.cpp +++ b/Userland/Utilities/purge.cpp @@ -5,10 +5,11 @@ */ #include <LibCore/ArgsParser.h> +#include <LibMain/Main.h> #include <serenity.h> #include <stdio.h> -int main(int argc, char** argv) +ErrorOr<int> serenity_main(Main::Arguments arguments) { int mode = 0; @@ -18,7 +19,7 @@ int main(int argc, char** argv) Core::ArgsParser args_parser; args_parser.add_option(purge_all_volatile, "Mode PURGE_ALL_VOLATILE", nullptr, 'v'); args_parser.add_option(purge_all_clean_inode, "Mode PURGE_ALL_CLEAN_INODE", nullptr, 'c'); - args_parser.parse(argc, argv); + args_parser.parse(arguments); if (!purge_all_volatile && !purge_all_clean_inode) purge_all_volatile = purge_all_clean_inode = true; |