I am getting acquainted with the utility for advanced boost settings, and I wonder if there is a way to define mutually exclusive groups of options. Ie, my program has different threads:
program --first --opt1 --opt2 ...
program --second --opt3 --opt4 ...
So, my options for different threads are mutually exclusive. Is there a way to define mutually exclusive groups of options?
Of course, the code below will do this:
void conflicting_options(const variables_map& vm, const char* opt1, const char* opt2) { if (vm.count(opt1) && !vm[opt1].defaulted() && vm.count(opt2) && !vm[opt2].defaulted()) throw logic_error(string("Conflicting options '") + opt1 + "' and '" + opt2 + "'."); } int main(int ac, char* av[]) { try {
But I have too many options, so it would be nice to do checks only for groups.
Thanks in advance!
source share