diff options
-rw-r--r-- | base/gameDetector.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp index d1f340d706..89a2673dea 100644 --- a/base/gameDetector.cpp +++ b/base/gameDetector.cpp @@ -482,7 +482,11 @@ void GameDetector::parseCommandLine(int argc, char **argv) { goto ShowHelpAndExit; } } else { - if (i == (argc - 1)) { + // Last argument: this could be a target name. + // To verify this, check if there is either a game domain (i.e + // a configured target) matching this argument, or if we can + // find any target with that name. + if (i == (argc - 1) && (ConfMan.hasGameDomain(s) || findTarget(s))) { setGame(s); } else { if (current_option == NULL) |