mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:37:44 +00:00
open: Port to LibMain
This commit is contained in:
parent
73f431a7cb
commit
71c004b75f
2 changed files with 4 additions and 3 deletions
|
@ -142,7 +142,7 @@ target_link_libraries(nl LibMain)
|
||||||
target_link_libraries(notify LibGUI LibMain)
|
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)
|
target_link_libraries(open LibDesktop LibMain)
|
||||||
target_link_libraries(pape LibGUI)
|
target_link_libraries(pape LibGUI)
|
||||||
target_link_libraries(passwd LibCrypt LibMain)
|
target_link_libraries(passwd LibCrypt LibMain)
|
||||||
target_link_libraries(paste LibGUI)
|
target_link_libraries(paste LibGUI)
|
||||||
|
|
|
@ -11,15 +11,16 @@
|
||||||
#include <LibCore/EventLoop.h>
|
#include <LibCore/EventLoop.h>
|
||||||
#include <LibCore/File.h>
|
#include <LibCore/File.h>
|
||||||
#include <LibDesktop/Launcher.h>
|
#include <LibDesktop/Launcher.h>
|
||||||
|
#include <LibMain/Main.h>
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
{
|
{
|
||||||
Core::EventLoop loop;
|
Core::EventLoop loop;
|
||||||
Vector<const char*> urls_or_paths;
|
Vector<const char*> urls_or_paths;
|
||||||
Core::ArgsParser parser;
|
Core::ArgsParser parser;
|
||||||
parser.set_general_help("Open a file or URL by executing the appropriate program.");
|
parser.set_general_help("Open a file or URL by executing the appropriate program.");
|
||||||
parser.add_positional_argument(urls_or_paths, "URL or file path to open", "url-or-path");
|
parser.add_positional_argument(urls_or_paths, "URL or file path to open", "url-or-path");
|
||||||
parser.parse(argc, argv);
|
parser.parse(arguments);
|
||||||
|
|
||||||
bool all_ok = true;
|
bool all_ok = true;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue