I can create 2 mutually exclusive parameters using the following:
Option a = OptionBuilder.create("a"); Option b = OptionBuilder.create("b"); OptionGroup optgrp = new OptionGroup(); optgrp .setRequired(true); optgrp .addOption(a); optgrp .addOption(b);
The above will force the user to provide either option a or option b.
But if I have a third option, c:
Option c = OptionBuilder.create("c");
You can create mutually exclusive options, for example:
Or:
- Option a must be provided OR
- Both options b and c must be provided.
I could not see a way to do this with OptionGroup?
source share