From 9773c3cabc91434597c48b0b259c9c889bc12322 Mon Sep 17 00:00:00 2001 From: Kenneth Myhra Date: Sun, 30 Jan 2022 20:29:39 +0100 Subject: [PATCH] pape: Port to LibMain --- Userland/Utilities/CMakeLists.txt | 2 +- Userland/Utilities/pape.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt index 4681ca052a..69e481f1b6 100644 --- a/Userland/Utilities/CMakeLists.txt +++ b/Userland/Utilities/CMakeLists.txt @@ -143,7 +143,7 @@ target_link_libraries(notify LibGUI LibMain) target_link_libraries(nproc LibMain) target_link_libraries(ntpquery 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(paste LibGUI) target_link_libraries(pgrep LibRegex) diff --git a/Userland/Utilities/pape.cpp b/Userland/Utilities/pape.cpp index 790c7a47e9..b88d145c75 100644 --- a/Userland/Utilities/pape.cpp +++ b/Userland/Utilities/pape.cpp @@ -11,6 +11,7 @@ #include #include #include +#include static int handle_show_all() { @@ -70,7 +71,7 @@ static int handle_set_random() return 0; } -int main(int argc, char** argv) +ErrorOr serenity_main(Main::Arguments arguments) { bool show_all = 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(set_random, "Set random wallpaper", "set-random", 'r'); 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) return handle_show_all();