]> git.tdb.fi Git - builder.git/commitdiff
Properly process the command line arguments
authorMikko Rasa <tdb@tdb.fi>
Tue, 7 May 2013 18:42:39 +0000 (21:42 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 7 May 2013 18:42:39 +0000 (21:42 +0300)
source/buildercli.cpp

index 35eba9c03512fe9024c68aad1fe5e986cb9357de..c470f047f6a930653f2d3ddb63dd0b86d3f8eef5 100644 (file)
@@ -121,14 +121,16 @@ BuilderCLI::BuilderCLI(int argc, char **argv):
        else if(!clean && !create_makefile)
                build = true;
 
-       const vector<string> &args = getopt.get_args();
-       for(vector<string>::const_iterator i=args.begin(); i!=args.end(); ++i)
+       for(NameList::iterator i=cmdline_targets.begin(); i!=cmdline_targets.end(); )
        {
                string::size_type equal = i->find('=');
                if(equal!=string::npos)
+               {
                        cmdline_options.insert(Config::InputOptions::value_type(i->substr(0, equal), i->substr(equal+1)));
+                       cmdline_targets.erase(i++);
+               }
                else
-                       cmdline_targets.push_back(*i);
+                       ++i;
        }
 
        if(!work_dir.empty())