diff options
Diffstat (limited to 'base/commandLine.cpp')
-rw-r--r-- | base/commandLine.cpp | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 207ff79c4c..8fa2f54b03 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -602,9 +602,7 @@ static void listTargets() { } /** List all saves states for the given target. */ -static Common::Error listSaves(const char *target) { - Common::Error result = Common::kNoError; - +static void listSaves(const char *target) { // FIXME HACK g_system->initBackend(); @@ -629,14 +627,13 @@ static Common::Error listSaves(const char *target) { GameDescriptor game = EngineMan.findGame(gameid, &plugin); if (!plugin) { - warning("Could not find any plugin to handle target '%s' (gameid '%s')", target, gameid.c_str()); - return Common::kPluginNotFound; + error("Could not find any plugin to handle target '%s' (gameid '%s')", target, gameid.c_str()); + return; } if (!(*plugin)->hasFeature(MetaEngine::kSupportsListSaves)) { // TODO: Include more info about the target (desc, engine name, ...) ??? printf("ScummVM does not support listing save states for target '%s' (gameid '%s') .\n", target, gameid.c_str()); - result = Common::kPluginNotSupportSaves; } else { // Query the plugin for a list of savegames SaveStateList saveList = (*plugin)->listSaves(target); @@ -646,9 +643,6 @@ static Common::Error listSaves(const char *target) { printf(" Slot Description \n" " ---- ------------------------------------------------------\n"); - if (saveList.size() == 0) - result = Common::kNoSavesError; - for (SaveStateList::const_iterator x = saveList.begin(); x != saveList.end(); ++x) { printf(" %-4s %s\n", x->save_slot().c_str(), x->description().c_str()); // TODO: Could also iterate over the full hashmap, printing all key-value pairs @@ -657,8 +651,6 @@ static Common::Error listSaves(const char *target) { // Revert to the old active domain ConfMan.setActiveDomain(oldDomain); - - return result; } /** Lists all usable themes */ @@ -871,7 +863,7 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha #endif // DISABLE_COMMAND_LINE -Common::Error processSettings(Common::String &command, Common::StringMap &settings) { +bool processSettings(Common::String &command, Common::StringMap &settings) { #ifndef DISABLE_COMMAND_LINE @@ -880,33 +872,34 @@ Common::Error processSettings(Common::String &command, Common::StringMap &settin // have been loaded. if (command == "list-targets") { listTargets(); - return Common::kNoError; + return false; } else if (command == "list-games") { listGames(); - return Common::kNoError; + return false; } else if (command == "list-saves") { - return listSaves(settings["list-saves"].c_str()); + listSaves(settings["list-saves"].c_str()); + return false; } else if (command == "list-themes") { listThemes(); - return Common::kNoError; + return false; } else if (command == "version") { printf("%s\n", gScummVMFullVersion); printf("Features compiled in: %s\n", gScummVMFeatures); - return Common::kNoError; + return false; } else if (command == "help") { printf(HELP_STRING, s_appName); - return Common::kNoError; + return false; } #ifdef DETECTOR_TESTING_HACK else if (command == "test-detector") { runDetectorTest(); - return Common::kNoError; + return false; } #endif #ifdef UPGRADE_ALL_TARGETS_HACK else if (command == "upgrade-targets") { upgradeTargets(); - return Common::kNoError; + return false; } #endif @@ -978,7 +971,7 @@ Common::Error processSettings(Common::String &command, Common::StringMap &settin ConfMan.set(key, value, Common::ConfigManager::kTransientDomain); } - return Common::kArgumentNotProcessed; + return true; } } // End of namespace Base |