Skip to content

Commit

Permalink
Merge pull request #5033 from vladfi1/nogui-user
Browse files Browse the repository at this point in the history
Parse user directory on nogui CLI.
  • Loading branch information
degasus committed Mar 8, 2017
2 parents ac914e9 + ac3586f commit 7cc5604
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Source/Core/DolphinWX/MainNoGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> args = parser->args();

std::string boot_filename;
if (options.is_set("exec"))
{
boot_filename = static_cast<const char*>(options.get("exec"));
Expand All @@ -400,14 +400,20 @@ int main(int argc, char* argv[])
return 0;
}

std::string user_directory;
if (options.is_set("user"))
{
user_directory = static_cast<const char*>(options.get("user"));
}

platform = GetPlatform();
if (!platform)
{
fprintf(stderr, "No platform found\n");
return 1;
}

UICommon::SetUserDirectory(""); // Auto-detect user folder
UICommon::SetUserDirectory(user_directory);
UICommon::Init();

Core::SetOnStoppedCallback([]() { s_running.Clear(); });
Expand Down

0 comments on commit 7cc5604

Please sign in to comment.