diff options
author | german77 <juangerman-13@hotmail.com> | 2021-03-27 18:34:48 +0100 |
---|---|---|
committer | german77 <juangerman-13@hotmail.com> | 2021-03-27 18:34:48 +0100 |
commit | 9cebde760f1a268219f68970601521ad355ac192 (patch) | |
tree | 4fdd19601dc2a99d40aec0ac995ff0a6e55a9230 | |
parent | Merge pull request #6101 from ogniK5377/alloc-as-ex (diff) | |
download | yuzu-9cebde760f1a268219f68970601521ad355ac192.tar yuzu-9cebde760f1a268219f68970601521ad355ac192.tar.gz yuzu-9cebde760f1a268219f68970601521ad355ac192.tar.bz2 yuzu-9cebde760f1a268219f68970601521ad355ac192.tar.lz yuzu-9cebde760f1a268219f68970601521ad355ac192.tar.xz yuzu-9cebde760f1a268219f68970601521ad355ac192.tar.zst yuzu-9cebde760f1a268219f68970601521ad355ac192.zip |
-rw-r--r-- | src/yuzu/main.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 24bfa4d34..06445b993 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -320,6 +320,34 @@ GMainWindow::GMainWindow() continue; } + // Launch game with a specific user + if (args[i] == QStringLiteral("-u")) { + if (i >= args.size() - 1) { + continue; + } + + if (args[i + 1].startsWith(QChar::fromLatin1('-'))) { + continue; + } + + bool argument_ok; + const std::size_t selected_user = args[++i].toUInt(&argument_ok); + + if (!argument_ok) { + LOG_ERROR(Frontend, "Invalid user argument"); + continue; + } + + const Service::Account::ProfileManager manager; + if (!manager.UserExistsIndex(selected_user)) { + LOG_ERROR(Frontend, "Selected user doesn't exist"); + continue; + } + + Settings::values.current_user = selected_user; + continue; + } + // Launch game at path if (args[i] == QStringLiteral("-g")) { if (i >= args.size() - 1) { |