diff --git a/Source/Core/DolphinWX/MainNoGUI.cpp b/Source/Core/DolphinWX/MainNoGUI.cpp index 5ba439d19f..83dcae0e1a 100644 --- a/Source/Core/DolphinWX/MainNoGUI.cpp +++ b/Source/Core/DolphinWX/MainNoGUI.cpp @@ -380,11 +380,11 @@ static Platform* GetPlatform() int main(int argc, char* argv[]) { - std::string boot_filename; auto parser = CommandLineParse::CreateParser(CommandLineParse::ParserOptions::OmitGUIOptions); optparse::Values& options = CommandLineParse::ParseArguments(parser.get(), argc, argv); std::vector args = parser->args(); + std::string boot_filename; if (options.is_set("exec")) { boot_filename = static_cast(options.get("exec")); @@ -400,6 +400,12 @@ int main(int argc, char* argv[]) return 0; } + std::string user_directory; + if (options.is_set("user")) + { + user_directory = static_cast(options.get("user")); + } + platform = GetPlatform(); if (!platform) { @@ -407,7 +413,7 @@ int main(int argc, char* argv[]) return 1; } - UICommon::SetUserDirectory(""); // Auto-detect user folder + UICommon::SetUserDirectory(user_directory); UICommon::Init(); Core::SetOnStoppedCallback([]() { s_running.Clear(); });