Program_options - allowing unknown options in configuration file
Hi everyone. I'm new to Boost and program_options in particular but so far it has been a joy working with the various boost libraries. Thanks to all the developers for their hard work! I'm using program_options to parse a configuration file but I need to have some options that are not described with program_options. Specifically, I need to use the same file for both my program configuration and also for configuring log4cxx. Each line of log4cxx configuration is of the form "log4j.option=value" and I can't limit the options that can be added to the program, so I can't describe them and ignore them afterwards. I know this is possible on the command line, by calling allow_unregistered() but I need the same thing for a config file, which I can't find out how to do anywhere. Can someone point me in the right direction, please? Thanks in advance. Raul PS - Happy New Year, everyone! :-) ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
Raul Pedro Santos wrote:
Hi everyone.
I'm new to Boost and program_options in particular but so far it has been a joy working with the various boost libraries. Thanks to all the developers for their hard work!
I'm using program_options to parse a configuration file but I need to have some options that are not described with program_options.
Specifically, I need to use the same file for both my program configuration and also for configuring log4cxx. Each line of log4cxx configuration is of the form "log4j.option=value" and I can't limit the options that can be added to the program, so I can't describe them and ignore them afterwards.
I know this is possible on the command line, by calling allow_unregistered() but I need the same thing for a config file, which I can't find out how to do anywhere.
Can someone point me in the right direction, please?
I think SVN HEAD supports unregistered options in config file. - Volodya
Volodya said:
I think SVN HEAD supports unregistered options in config file.
It seems to do so for config files, but not for the environment. I noticed a commented out bit of code where you seemed to be considering the ability to disable the check regardless of how the options are parsed. (in variables_map.cpp, around line 60) // Ignore options which are not described //TODO: consider this. //if (desc.count(name) == 0) // continue; So are you considering that? I would love that as a feature, possibly one I can enable or disable through the parsed_options class. -- John Femiani
participants (3)
-
John Femiani
-
Raul Pedro Santos
-
Vladimir Prus