From 20cad6e8b6fe9ae843245697e872256c4ca1e545 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 23 May 2011 19:36:45 +0200 Subject: 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. --- base/commandLine.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'base/commandLine.h') diff --git a/base/commandLine.h b/base/commandLine.h index 4e611d97bf..2798ab0934 100644 --- a/base/commandLine.h +++ b/base/commandLine.h @@ -32,9 +32,28 @@ class String; namespace Base { +/** + * Register various defaults with the ConfigManager. + */ void registerDefaults(); + +/** + * Parse the command line for options and a command; the options + * are stored in the map 'settings, the command (if any) is returned. + */ Common::String parseCommandLine(Common::StringMap &settings, int argc, const char * const *argv); -Common::Error processSettings(Common::String &command, Common::StringMap &settings); + +/** + * Process the command line options and arguments. + * Returns true if everything was handled and ScummVM should quit + * (e.g. because "--help" was specified, and handled). + * + * @param[in] command the command as returned by parseCommandLine + * @param[in] settings the settings as returned by parseCommandLine + * @param[out] err indicates whether any error occurred, and which + * @return true if the command was completely processed and ScummVM should quit, false otherwise + */ +bool processSettings(Common::String &command, Common::StringMap &settings, Common::Error &err); } // End of namespace Base -- cgit v1.2.3