open: Port to LibMain

This commit is contained in:
Kenneth Myhra 2022-01-30 20:01:49 +01:00 committed by Andreas Kling
parent 73f431a7cb
commit 71c004b75f
Notes: sideshowbarker 2024-07-17 19:56:54 +09:00
2 changed files with 4 additions and 3 deletions

View file

@ -142,7 +142,7 @@ target_link_libraries(nl LibMain)
target_link_libraries(notify LibGUI LibMain)
target_link_libraries(nproc 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(passwd LibCrypt LibMain)
target_link_libraries(paste LibGUI)

View file

@ -11,15 +11,16 @@
#include <LibCore/EventLoop.h>
#include <LibCore/File.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;
Vector<const char*> urls_or_paths;
Core::ArgsParser parser;
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.parse(argc, argv);
parser.parse(arguments);
bool all_ok = true;