diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt index ae460245323..24f2af1d334 100644 --- a/Userland/Utilities/CMakeLists.txt +++ b/Userland/Utilities/CMakeLists.txt @@ -66,7 +66,7 @@ target_link_libraries(checksum LibCrypto LibMain) target_link_libraries(chmod LibMain) target_link_libraries(chgrp LibMain) target_link_libraries(chown LibMain) -target_link_libraries(chres LibGUI) +target_link_libraries(chres LibGUI LibMain) target_link_libraries(cksum LibCrypto) target_link_libraries(config LibConfig) target_link_libraries(copy LibGUI LibMain) diff --git a/Userland/Utilities/chres.cpp b/Userland/Utilities/chres.cpp index 17d3d8e1f6b..07ffb47332e 100644 --- a/Userland/Utilities/chres.cpp +++ b/Userland/Utilities/chres.cpp @@ -7,8 +7,9 @@ #include #include #include +#include -int main(int argc, char** argv) +ErrorOr serenity_main(Main::Arguments arguments) { int screen = 0; int width = -1; @@ -21,10 +22,10 @@ int main(int argc, char** argv) args_parser.add_positional_argument(width, "Width", "width"); args_parser.add_positional_argument(height, "Height", "height"); args_parser.add_positional_argument(scale, "Scale Factor", "scale", Core::ArgsParser::Required::No); - args_parser.parse(argc, argv); + args_parser.parse(arguments); // A Core::EventLoop is all we need, but WindowServerConnection needs a full Application object. - char* dummy_argv[] = { argv[0] }; + char* dummy_argv[] = { arguments.argv[0] }; auto app = GUI::Application::construct(1, dummy_argv); auto screen_layout = GUI::WindowServerConnection::the().get_screen_layout(); if (screen < 0 || (size_t)screen >= screen_layout.screens.size()) { @@ -40,4 +41,6 @@ int main(int argc, char** argv) warnln("failed to set resolution: {}", set_result.error_msg()); return 1; } + + return 0; }