From: Mikko Rasa Date: Tue, 7 May 2013 18:42:39 +0000 (+0300) Subject: Properly process the command line arguments X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;ds=sidebyside;h=cb286fd20b9b194947b6b583bf18f8d7e57ae995;p=builder.git Properly process the command line arguments --- diff --git a/source/buildercli.cpp b/source/buildercli.cpp index 35eba9c..c470f04 100644 --- a/source/buildercli.cpp +++ b/source/buildercli.cpp @@ -121,14 +121,16 @@ BuilderCLI::BuilderCLI(int argc, char **argv): else if(!clean && !create_makefile) build = true; - const vector &args = getopt.get_args(); - for(vector::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())