From 71a3c2fcd13051dbaed45c69107a6e6b4a94cfe8 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 13 Mar 2012 01:32:21 +0200 Subject: Allow directly supplying world as a parameter, including world.mt --- src/settings.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/settings.h') diff --git a/src/settings.h b/src/settings.h index 0b828e2a5..b95fbd184 100644 --- a/src/settings.h +++ b/src/settings.h @@ -330,6 +330,7 @@ public: bool parseCommandLine(int argc, char *argv[], core::map &allowed_options) { + int nonopt_index = 0; int i=1; for(;;) { @@ -338,6 +339,15 @@ public: std::string argname = argv[i]; if(argname.substr(0, 2) != "--") { + // If option doesn't start with -, read it in as nonoptX + if(argname[0] != '-'){ + std::string name = "nonopt"; + name += itos(nonopt_index); + set(name, argname); + nonopt_index++; + i++; + continue; + } errorstream<<"Invalid command-line parameter \"" < expected."<