mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:07:45 +00:00
pape: Port to LibMain
This commit is contained in:
parent
0dc46da99f
commit
9773c3cabc
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(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)
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue