aboutsummaryrefslogtreecommitdiff
path: root/base/commandLine.cpp
diff options
context:
space:
mode:
authorMax Horn2011-04-18 18:19:53 +0200
committerMax Horn2011-04-18 18:22:04 +0200
commit3a574199b0b3e848d786d71a50a1107536507479 (patch)
tree3a9b0bd121b780d71ea5c5f310ead62efe5209bf /base/commandLine.cpp
parent1037ed247042485df1ad312d9ddfbd17251ed907 (diff)
downloadscummvm-rg350-3a574199b0b3e848d786d71a50a1107536507479.tar.gz
scummvm-rg350-3a574199b0b3e848d786d71a50a1107536507479.tar.bz2
scummvm-rg350-3a574199b0b3e848d786d71a50a1107536507479.zip
COMMON: Cleanup names/handling of some error codes
Diffstat (limited to 'base/commandLine.cpp')
-rw-r--r--base/commandLine.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index f920dd0170..7c482d3057 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -641,29 +641,30 @@ 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;
+ return Common::Error(Common::kEnginePluginNotFound,
+ Common::String::format("target '%s', gameid '%s", target, gameid.c_str()));
}
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;
+ return Common::Error(Common::kEnginePluginNotSupportSaves,
+ Common::String::format("target '%s', gameid '%s", target, gameid.c_str()));
} else {
// Query the plugin for a list of savegames
SaveStateList saveList = (*plugin)->listSaves(target);
- // TODO: Include more info about the target (desc, engine name, ...) ???
- printf("Saves for target '%s' (gameid '%s'):\n", target, gameid.c_str());
- printf(" Slot Description \n"
- " ---- ------------------------------------------------------\n");
-
- if (saveList.size() == 0)
- result = Common::kNoSavesError;
+ if (saveList.size() > 0) {
+ // TODO: Include more info about the target (desc, engine name, ...) ???
+ printf("Save states for target '%s' (gameid '%s'):\n", target, gameid.c_str());
+ printf(" Slot Description \n"
+ " ---- ------------------------------------------------------\n");
- 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
+ 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
+ }
+ } else {
+ printf("There are no save states for target '%s' (gameid '%s'):\n", target, gameid.c_str());
}
}