diff --git a/src/main.cpp b/src/main.cpp index 00776d89..b1849e4a 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<