From: Perttu Ahola Date: Sun, 11 Mar 2012 13:20:42 +0000 (+0200) Subject: --gameid list X-Git-Tag: 0.4.dev-20120318~49 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e71d75ed9a8893b2ee67c6953ab633dd210c072c;p=oweals%2Fminetest.git --gameid list --- diff --git a/src/main.cpp b/src/main.cpp index 00776d89c..b1849e4a7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -783,7 +783,7 @@ int main(int argc, char *argv[]) allowed_options.insert("logfile", ValueSpec(VALUETYPE_STRING, "Set logfile path (debug.txt)")); allowed_options.insert("gameid", ValueSpec(VALUETYPE_STRING, - "Set gameid")); + "Set gameid (\"--gameid list\" prints available ones)")); #ifndef SERVER allowed_options.insert("speedtests", ValueSpec(VALUETYPE_FLAG, "Run speed tests")); @@ -867,7 +867,17 @@ int main(int argc, char *argv[]) // Debug handler BEGIN_DEBUG_EXCEPTION_HANDLER - + + // List gameids if requested + if(cmd_args.exists("gameid") && cmd_args.get("gameid") == "list") + { + std::set gameids = getAvailableGameIds(); + for(std::set::const_iterator i = gameids.begin(); + i != gameids.end(); i++) + dstream<<(*i)< gameids = getAvailableGameIds(); - infostream<<"Available gameids: "; - for(std::set::const_iterator i = gameids.begin(); - i != gameids.end(); i++) - infostream<<(*i)<<" "; - infostream<