summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/yuzu/main.cpp28
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()
320 continue; 320 continue;
321 } 321 }
322 322
323 // Launch game with a specific user
324 if (args[i] == QStringLiteral("-u")) {
325 if (i >= args.size() - 1) {
326 continue;
327 }
328
329 if (args[i + 1].startsWith(QChar::fromLatin1('-'))) {
330 continue;
331 }
332
333 bool argument_ok;
334 const std::size_t selected_user = args[++i].toUInt(&argument_ok);
335
336 if (!argument_ok) {
337 LOG_ERROR(Frontend, "Invalid user argument");
338 continue;
339 }
340
341 const Service::Account::ProfileManager manager;
342 if (!manager.UserExistsIndex(selected_user)) {
343 LOG_ERROR(Frontend, "Selected user doesn't exist");
344 continue;
345 }
346
347 Settings::values.current_user = selected_user;
348 continue;
349 }
350
323 // Launch game at path 351 // Launch game at path
324 if (args[i] == QStringLiteral("-g")) { 352 if (args[i] == QStringLiteral("-g")) {
325 if (i >= args.size() - 1) { 353 if (i >= args.size() - 1) {