aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorJohannes Schickel2010-05-03 19:18:55 +0000
committerJohannes Schickel2010-05-03 19:18:55 +0000
commit2e188d6bd32a806350b9ab27e4e705982dcd77e6 (patch)
treee9b0ac4dcbfe10857e12f3d7e9217e1e689406c6 /base
parentc5436aebdd7234c6a89198b8766e47486b1cae7c (diff)
downloadscummvm-rg350-2e188d6bd32a806350b9ab27e4e705982dcd77e6.tar.gz
scummvm-rg350-2e188d6bd32a806350b9ab27e4e705982dcd77e6.tar.bz2
scummvm-rg350-2e188d6bd32a806350b9ab27e4e705982dcd77e6.zip
Show the user a nice message, when the target passed to --list-saves does not allow listing of its save states.
This is a first step into implementing FR #2988017 "exit status with --list-saves always 0". svn-id: r48923
Diffstat (limited to 'base')
-rw-r--r--base/commandLine.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index 8846f4bcc6..7dbf4e0fe1 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -631,17 +631,22 @@ static void listSaves(const char *target) {
return;
}
- // 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':\n", target);
- 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
+ if (!(*plugin)->hasFeature(MetaEngine::kSupportsListSaves)) {
+ // TODO: Include more info about the target (desc, engine name, ...) ???
+ printf("Target '%s' does not support listing of its save states.\n", target);
+ } 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':\n", target);
+ 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
+ }
}
// Revert to the old active domain