|
Boost : |
Subject: [boost] [program_options] A couple of proposed changes (patches included)
From: jcwilson.boost_at_[hidden]
Date: 2010-12-09 23:18:19
I've been making use of this library for the past week and it's
been very helpful. I've found a couple of ways to improve it for
my use and wanted to see if it'd be worth sending the changes
upstream, too.
1) Allow default value specification at option query time. This
would override the default value (if any) defined in the
options_description for this particular query.
buffer_size = options["buffer_size"].as<unsigned int>(1024);
2) Add the option name as a parameter to the "notifier" function
signature. This became necessary when I started using the
wildcard(*) functionality. How else am I to know what the matched
config variable was? I just replaced boost::function1 with
boost::function2.
I imagine this one would need a bit more work since it would break
any current users. I could take a stab at it, but if it seems
useful, maybe someone more familiar with the library would rather
take care of it instead.
I'm pretty new to Boost development, so I'm not sure what the next
steps would be. The attached patches are against the boost_1_45_0
release.
-Josh
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk