]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/settings.h
Move ClientMap to clientmap.{h,cpp}
[dragonfireclient.git] / src / settings.h
index 0b828e2a5a09356e1501758ca9444e24818965ec..b95fbd1845ef4f5eae88ba24f4160b587882134f 100644 (file)
@@ -330,6 +330,7 @@ class Settings
        bool parseCommandLine(int argc, char *argv[],
                        core::map<std::string, ValueSpec> &allowed_options)
        {
+               int nonopt_index = 0;
                int i=1;
                for(;;)
                {
@@ -338,6 +339,15 @@ class Settings
                        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 \""
                                                <<argname<<"\": --<option> expected."<<std::endl;
                                return false;