Boost logo

Boost Users :

From: Vsevolod Vlaskin (vlaskine_at_[hidden])
Date: 2006-01-05 00:24:19


I am trying to allow unknown options in the command
line of my application (as described in "Allowing
Unknown Options" section of program_options docs).

Here is the code snippet:

    /* adding some allowed options */
boost::program_options::variables_map vm;

boost::program_options::command_line_parser( ac, av
).options( my_options ).allow_unregistered().run(), vm

boost::program_options::notify( vm );

If an option is not specified in my_options, the call
boost::program_options::store() above throws exception
"unknown option". (I checked that it is store() that

Does anyone have any suggestions how I could store and
access the option values in this case? Of course, I
can use basic_parsed_options returned by run(), but it
seems to defeat the convenience of the library. Is
there any way to use store() and variables_map in this

Thank you for help.

Best regards,

Vsevolod Vlaskine

Yahoo! DSL – Something to write home about.
Just $16.99/mo. or less.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at