1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:17:44 +00:00

pape: Port to LibMain

This commit is contained in:
Kenneth Myhra 2022-01-30 20:29:39 +01:00 committed by Andreas Kling
parent 0dc46da99f
commit 9773c3cabc
2 changed files with 5 additions and 4 deletions

View file

@ -143,7 +143,7 @@ target_link_libraries(notify LibGUI LibMain)
target_link_libraries(nproc LibMain) target_link_libraries(nproc LibMain)
target_link_libraries(ntpquery LibMain) target_link_libraries(ntpquery LibMain)
target_link_libraries(open LibDesktop LibMain) target_link_libraries(open LibDesktop LibMain)
target_link_libraries(pape LibGUI) target_link_libraries(pape LibGUI LibMain)
target_link_libraries(passwd LibCrypt LibMain) target_link_libraries(passwd LibCrypt LibMain)
target_link_libraries(paste LibGUI) target_link_libraries(paste LibGUI)
target_link_libraries(pgrep LibRegex) target_link_libraries(pgrep LibRegex)

View file

@ -11,6 +11,7 @@
#include <LibCore/DirIterator.h> #include <LibCore/DirIterator.h>
#include <LibGUI/Application.h> #include <LibGUI/Application.h>
#include <LibGUI/Desktop.h> #include <LibGUI/Desktop.h>
#include <LibMain/Main.h>
static int handle_show_all() static int handle_show_all()
{ {
@ -70,7 +71,7 @@ static int handle_set_random()
return 0; return 0;
} }
int main(int argc, char** argv) ErrorOr<int> serenity_main(Main::Arguments arguments)
{ {
bool show_all = false; bool show_all = false;
bool show_current = false; bool show_current = false;
@ -82,9 +83,9 @@ int main(int argc, char** argv)
args_parser.add_option(show_current, "Show current wallpaper", "show-current", 'c'); args_parser.add_option(show_current, "Show current wallpaper", "show-current", 'c');
args_parser.add_option(set_random, "Set random wallpaper", "set-random", 'r'); args_parser.add_option(set_random, "Set random wallpaper", "set-random", 'r');
args_parser.add_positional_argument(name, "Wallpaper to set", "name", Core::ArgsParser::Required::No); args_parser.add_positional_argument(name, "Wallpaper to set", "name", Core::ArgsParser::Required::No);
args_parser.parse(argc, argv); args_parser.parse(arguments);
auto app = GUI::Application::construct(argc, argv); auto app = TRY(GUI::Application::try_create(arguments));
if (show_all) if (show_all)
return handle_show_all(); return handle_show_all();