Boost logo

Boost Users :

Subject: Re: [Boost-users] problem with boost::program_options - unregistered option in Config File
From: Vladimir Prus (vladimir_at_[hidden])
Date: 2009-06-25 14:57:34


Hasanul Ferdaus wrote:

> But the value of the option node.initiator (i.e. "true") is not shown, also there is no exception.
> If I pass "false" in the 3rd parameter of parse_config_file() rather than "true", it throws
> exception, as it should do. But my question is, why "node.initiator" option is not in the
> variablesMap, as parse_config_file() should have parsed both registered and unregistered options.

Why? Documentation say that you should use collect_unrecognized:

        http://www.boost.org/doc/libs/1_39_0/doc/html/program_options/howto.html#id2894348

It does not seem reasonable to not declare an option and then expect that the interface
specifically design to work with previously registered options will be useful.

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net