[Scummvm-cvs-logs] SF.net SVN: scummvm:[35045] scummvm/trunk/base/commandLine.cpp
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Thu Nov 13 13:45:35 CET 2008
Revision: 35045
http://scummvm.svn.sourceforge.net/scummvm/?rev=35045&view=rev
Author: fingolfin
Date: 2008-11-13 12:45:35 +0000 (Thu, 13 Nov 2008)
Log Message:
-----------
Added DISABLE_COMMAND_LINE switch
Modified Paths:
--------------
scummvm/trunk/base/commandLine.cpp
Modified: scummvm/trunk/base/commandLine.cpp
===================================================================
--- scummvm/trunk/base/commandLine.cpp 2008-11-13 12:25:19 UTC (rev 35044)
+++ scummvm/trunk/base/commandLine.cpp 2008-11-13 12:45:35 UTC (rev 35045)
@@ -38,6 +38,8 @@
namespace Base {
+#ifndef DISABLE_COMMAND_LINE
+
static const char USAGE_STRING[] =
"%s: %s\n"
"Usage: %s [OPTIONS]... [GAME]\n"
@@ -139,6 +141,9 @@
exit(1);
}
+#endif // DISABLE_COMMAND_LINE
+
+
void registerDefaults() {
// Graphics
@@ -205,6 +210,8 @@
// Various macros used by the command line parser.
//
+#ifndef DISABLE_COMMAND_LINE
+
// Use this for options which have an *optional* value
#define DO_OPTION_OPT(shortCmd, longCmd, defaultVal) \
if (isLongCmd ? (!strcmp(s+2, longCmd) || !memcmp(s+2, longCmd"=", sizeof(longCmd"=") - 1)) : (tolower(s[1]) == shortCmd)) { \
@@ -513,8 +520,7 @@
}
}
-
- return Common::String::emptyString;
+ return Common::String();
}
/** List all supported game IDs, i.e. all games which any loaded plugin supports. */
@@ -677,8 +683,21 @@
}
#endif
+#else // DISABLE_COMMAND_LINE
+
+
+Common::String parseCommandLine(Common::StringMap &settings, int argc, char **argv) {
+ return Common::String();
+}
+
+
+#endif // DISABLE_COMMAND_LINE
+
+
bool processSettings(Common::String &command, Common::StringMap &settings) {
+#ifndef DISABLE_COMMAND_LINE
+
// Handle commands passed via the command line (like --list-targets and
// --list-games). This must be done after the config file and the plugins
// have been loaded.
@@ -706,7 +725,9 @@
}
#endif
+#endif // DISABLE_COMMAND_LINE
+
// If a target was specified, check whether there is either a game
// domain (i.e. a target) matching this argument, or alternatively
// whether there is a gameid matching that name.
@@ -731,7 +752,9 @@
ConfMan.set("id_came_from_command_line", "1");
} else {
+#ifndef DISABLE_COMMAND_LINE
usage("Unrecognized game target '%s'", command.c_str());
+#endif // DISABLE_COMMAND_LINE
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list