CLI11
CLI11 copied to clipboard
Group can exclude option, but not the reverse
As far as I can tell, exclude() is a symmetric operation, i.e. opt1->exclude(opt2); is the same as opt2->exclude(opt1);. With options this works well, since I can call exclude() on either of the options and pass the other as a parameter. But if I have an option and a group the are mutually exclusive, I can only do the call from the group side, i.e. grp1->exclude(opt1); works, but opt1->exclude(grp1); doesn't compile.
Maybe an overload should be added to allow this to work in both directions.
I do not believe this would be possible or wise as it would require circular definitions.
The recommendation to achieve the same effect is to put opt1 in a second option_group and use
grp2->exclude(grp1)
Going to close this as there is an intended means to achieve the same effect and adding this suggestion would add significant complexity to the option handing code.