From 92493b210aa3b41060d8eb2d9e31572d1194320f Mon Sep 17 00:00:00 2001 From: mjz19910 Date: Mon, 3 Jan 2022 21:17:27 -0700 Subject: [PATCH] wsctl: Port to LibMain --- Userland/Utilities/CMakeLists.txt | 2 +- Userland/Utilities/wsctl.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt index dbb4323a0c..7e7087a940 100644 --- a/Userland/Utilities/CMakeLists.txt +++ b/Userland/Utilities/CMakeLists.txt @@ -164,6 +164,6 @@ target_link_libraries(w LibMain) target_link_libraries(wasm LibWasm LibLine) target_link_libraries(whoami LibMain) target_link_libraries(watch LibMain) -target_link_libraries(wsctl LibGUI) +target_link_libraries(wsctl LibGUI LibMain) target_link_libraries(xargs LibMain) target_link_libraries(yes LibMain) diff --git a/Userland/Utilities/wsctl.cpp b/Userland/Utilities/wsctl.cpp index 6122ecb363..f0ab607f76 100644 --- a/Userland/Utilities/wsctl.cpp +++ b/Userland/Utilities/wsctl.cpp @@ -8,17 +8,16 @@ #include #include -int main(int argc, char** argv) +ErrorOr serenity_main(Main::Arguments arguments) { - auto app = GUI::Application::construct(argc, argv); + auto app = GUI::Application::construct(arguments); int flash_flush = -1; Core::ArgsParser args_parser; args_parser.add_option(flash_flush, "Flash flush (repaint) rectangles", "flash-flush", 'f', "0/1"); - args_parser.parse(argc, argv); + args_parser.parse(arguments); - if (flash_flush != -1) { + if (flash_flush != -1) GUI::WindowServerConnection::the().async_set_flash_flush(flash_flush); - } return 0; }