diff options
author | Max Horn | 2011-05-23 19:36:45 +0200 |
---|---|---|
committer | Max Horn | 2011-05-23 19:39:25 +0200 |
commit | 20cad6e8b6fe9ae843245697e872256c4ca1e545 (patch) | |
tree | e6ddd7b3f8ff6be39ea9ceab523050e73e3ba354 /base/commandLine.cpp | |
parent | 6f6051a9e1da4d4debc1bf851b101c7a40d8b531 (diff) | |
download | scummvm-rg350-20cad6e8b6fe9ae843245697e872256c4ca1e545.tar.gz scummvm-rg350-20cad6e8b6fe9ae843245697e872256c4ca1e545.tar.bz2 scummvm-rg350-20cad6e8b6fe9ae843245697e872256c4ca1e545.zip |
COMMON: Modify Base::processSettings, get rid of Common::kArgumentNotProcessed
Instead of defining a hacked up Common::Error code, split the return
value of processSettings into two parts: An error code, and a value
which indicates whether the specified command was completely handled
by processSettings or not.
Diffstat (limited to 'base/commandLine.cpp')
-rw-r--r-- | base/commandLine.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/base/commandLine.cpp b/base/commandLine.cpp index f819b03658..78eea50082 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -23,6 +23,8 @@ // FIXME: Avoid using printf #define FORBIDDEN_SYMBOL_EXCEPTION_printf +#define FORBIDDEN_SYMBOL_EXCEPTION_exit + #include "engines/metaengine.h" #include "base/commandLine.h" #include "base/plugins.h" @@ -885,7 +887,8 @@ 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, Common::Error &err) { + err = Common::kNoError; #ifndef DISABLE_COMMAND_LINE @@ -894,33 +897,34 @@ Common::Error processSettings(Common::String &command, Common::StringMap &settin // have been loaded. if (command == "list-targets") { listTargets(); - return Common::kNoError; + return true; } else if (command == "list-games") { listGames(); - return Common::kNoError; + return true; } else if (command == "list-saves") { - return listSaves(settings["list-saves"].c_str()); + err = listSaves(settings["list-saves"].c_str()); + return true; } else if (command == "list-themes") { listThemes(); - return Common::kNoError; + return true; } else if (command == "version") { printf("%s\n", gScummVMFullVersion); printf("Features compiled in: %s\n", gScummVMFeatures); - return Common::kNoError; + return true; } else if (command == "help") { printf(HELP_STRING, s_appName); - return Common::kNoError; + return true; } #ifdef DETECTOR_TESTING_HACK else if (command == "test-detector") { runDetectorTest(); - return Common::kNoError; + return true; } #endif #ifdef UPGRADE_ALL_TARGETS_HACK else if (command == "upgrade-targets") { upgradeTargets(); - return Common::kNoError; + return true; } #endif @@ -972,7 +976,7 @@ Common::Error processSettings(Common::String &command, Common::StringMap &settin ConfMan.set(key, value, Common::ConfigManager::kTransientDomain); } - return Common::kArgumentNotProcessed; + return false; } } // End of namespace Base |