Skip to content

Commit

Permalink
CMD: Update error codes in case of autodetector error
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiatesan authored and criezy committed Aug 6, 2017
1 parent 426ec1f commit 31c541b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions base/commandLine.cpp
Expand Up @@ -878,9 +878,9 @@ static Common::String detectGames(Common::String path, Common::String recursiveO
GameList candidates = recListGames(dir, recursive);

if (candidates.empty()) {
printf("ScummVM could not find any game in %s\n", dir.getPath().c_str());
printf("WARNING: ScummVM could not find any game in %s\n", dir.getPath().c_str());
if (!recursive) {
printf("Consider using --recursive to search inside subdirectories\n");
printf("WARNING: Consider using --recursive *before* --add or --detect to search inside subdirectories\n");
}
return Common::String();
}
Expand Down Expand Up @@ -1167,15 +1167,18 @@ bool processSettings(Common::String &command, Common::StringMap &settings, Commo
// If we get a non-empty ID, we store it in command so that it gets processed together with the
// other command line options below.
if (settings["recursive"] == "true") {
printf("Autodetection not supported with --recursive; are you sure you didn't want --detect?\n");
printf("ERROR: Autodetection not supported with --recursive; are you sure you didn't want --detect?\n");
err = Common::kUnknownError;
return true;
// There is not a particularly good technical reason for this.
// From an UX point of view, however, it might get confusing.
// Consider removing this if consensus says otherwise.
} else {
command = detectGames(settings["path"], settings["recursive"]);
if (command.empty())
if (command.empty()) {
err = Common::kNoGameDataFoundError;
return true;
}
}
} else if (command == "detect") {
detectGames(settings["path"], settings["recursive"]);
Expand Down

0 comments on commit 31c541b

Please sign in to comment.