diff --git a/Core/CmdLine.cpp b/Core/CmdLine.cpp index d41635e1de..02964468b3 100644 --- a/Core/CmdLine.cpp +++ b/Core/CmdLine.cpp @@ -139,6 +139,7 @@ static const CommandLineParam g_autoParams[] = { {POFF(startScreen), CmdParamType::String, "start-screen", '\0', "Start on a specific screen (e.g. 'gamesettings', 'touchscreentest')", CmdLineMode::Application}, {POFF(escapeExit), CmdParamType::Bool, "escape-exit", '\0', "Escape key exits the application", CmdLineMode::Application}, {POFF(pauseMenuExit), CmdParamType::Bool, "pause-menu-exit", '\0', "Change \"Exit to menu\" in pause menu to \"Exit\"", CmdLineMode::Application}, + {POFF(enableDebugger), CmdParamType::Bool, "debugger", '\0', "Enable the WebSocket debugger on startup (see docs/WebSocketDebugger.md)", CmdLineMode::Application}, {POFF(appendConfig), CmdParamType::String, "appendconfig", '\0', "Merge config FILE into the current configuration"}, {POFF(root), CmdParamType::String, "root", 'r', "Mount root directory"}, {POFF(stateToLoad), CmdParamType::String, "state", '\0', "Load state from specified file"}, @@ -395,6 +396,11 @@ void CommandLineOptions::ApplyToConfig() const { g_Config.bPauseMenuExitsEmulator = pauseMenuExit.value(); } + if (enableDebugger.has_value()) { + g_Config.bRemoteDebuggerOnStartup = enableDebugger.value(); + g_Config.DoNotSaveSetting(&g_Config.bRemoteDebuggerOnStartup); + } + if (logLevel.has_value()) { g_logManager.SetAllLogLevels(logLevel.value()); } diff --git a/Core/CmdLine.h b/Core/CmdLine.h index 99f08822e5..573886a903 100644 --- a/Core/CmdLine.h +++ b/Core/CmdLine.h @@ -40,6 +40,9 @@ struct CommandLineOptions { std::optional escapeExit; std::optional pauseMenuExit; + // Enables the WebSocket debugger on startup (Application mode only - see docs/WebSocketDebugger.md). + std::optional enableDebugger; + std::optional appendConfig; std::optional root; // mount root, needs more explanation std::optional stateToLoad;