/* * Copyright (c) 2018-2020, Andreas Kling * Copyright (c) 2023, Andrew Kaster * Copyright (c) 2023, Lucas Chollet * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include #include #include #if defined(AK_OS_MACOS) # include #endif ErrorOr serenity_main(Main::Arguments arguments) { AK::set_rich_debug_enabled(true); Core::ArgsParser args_parser; StringView mach_server_name; bool wait_for_debugger = false; args_parser.add_option(mach_server_name, "Mach server name", "mach-server-name", 0, "mach_server_name"); args_parser.add_option(wait_for_debugger, "Wait for debugger", "wait-for-debugger"); args_parser.parse(arguments); if (wait_for_debugger) Core::Process::wait_for_debugger_and_break(); Core::EventLoop event_loop; #if defined(AK_OS_MACOS) if (!mach_server_name.is_empty()) Core::Platform::register_with_mach_server(mach_server_name); #endif auto client = TRY(IPC::take_over_accepted_client_from_system_server()); return event_loop.exec(); }