mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
pape: Port to LibMain
This commit is contained in:
parent
0dc46da99f
commit
9773c3cabc
Notes:
sideshowbarker
2024-07-17 19:56:46 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/9773c3cabc9 Pull-request: https://github.com/SerenityOS/serenity/pull/12221
2 changed files with 5 additions and 4 deletions
|
@ -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)
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <LibCore/DirIterator.h>
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/Desktop.h>
|
||||
#include <LibMain/Main.h>
|
||||
|
||||
static int handle_show_all()
|
||||
{
|
||||
|
@ -70,7 +71,7 @@ static int handle_set_random()
|
|||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
ErrorOr<int> 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();
|
||||
|
|
Loading…
Add table
Reference in a new issue