purge: Port to LibMain

This commit is contained in:
Brian Gianforcaro 2022-03-21 00:42:34 -07:00 committed by Andreas Kling
parent fbceebb717
commit 575fcc42c3
Notes: sideshowbarker 2024-07-17 16:57:18 +09:00
2 changed files with 4 additions and 2 deletions

View file

@ -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)

View file

@ -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;