Boost.Program_Options not working with short options

Posted by inajamaica on Stack Overflow See other posts from Stack Overflow or by inajamaica
Published on 2010-05-25T14:50:11Z Indexed on 2010/05/25 14:51 UTC
Read the original article Hit count: 435

Filed under:
|
|
|
|

I have the following options_description:

 po::options_description config("Configuration File or Command Line");

config.add_options() ("run-time,t", po::value(&runTime_)->default_value(1440.0), "set max simulation duration") ("starting-iteration,i", po::value(&startingIteration_)->default_value(1), "set starting simulation iteration") ("repetitions,r", po::value(&repetitions_)->default_value(100), "set number of iterations") ... ;

As you can see the three shown have a long,short names employed. The long versions all work. However, none of the short ones do, and each time I try a -t 12345.0 or a -i 12345, etc., I get the following from Program_Options:

std::logic_error: in option 'starting-iteration': invalid option value

I'm using Boost 1.42 on Win32. Any thoughts on what might be going on here? Thanks!

© Stack Overflow or respective owner

Related posts about boost

Related posts about value