[Coin-discuss] parameter parser

Matthew Galati magh at lehigh.edu
Sat Feb 10 23:51:06 EST 2007


Hi --

I looked at your OptionsList class. I think I see how to register 
options and how to read options from a file. Is it possible to read from 
a file, but then override an option at the command line?

For example - how would I do something like:

opts.txt:
optionA = 2
optionB= "ddd"

./myapp --param opts.txt --optionA 4

which would read opts.txt, but then override option1 to 4 based on 
command line?

Thanks,
Matt


> Hi,
>
> If you are looking for something implemented in COIN, you can also 
> have a look at the OptionsList class in Ipopt.  We also use it in Bonmin.
>
> Here are two quick links to the header files:
>
> https://projects.coin-or.org/Ipopt/browser/stable/3.2/Ipopt/src/Common/IpOptionsList.hpp 
>
> https://projects.coin-or.org/Ipopt/browser/stable/3.2/Ipopt/src/Common/IpRegOptions.hpp 
>
>
> Cheers
>
> Andreas
>
> On Fri, 9 Feb 2007, Matthew Galati wrote:
>
>> Hi --
>>
>> Is there a standard object for dealing with parameter parsing (from 
>> file / env / command line)? Just about every project has the need for 
>> such a thing and as far as I can tell, each project has its own 
>> method for doing this. Does this already exist (in CoinUtils) and I 
>> am missing it?
>>
>> Thanks,
>> Matt
>>
>> _______________________________________________
>> Coin-discuss mailing list
>> Coin-discuss at list.coin-or.org
>> http://list.coin-or.org/mailman/listinfo/coin-discuss
>>
> _______________________________________________
> Coin-discuss mailing list
> Coin-discuss at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/coin-discuss



More information about the Coin-discuss mailing list