Replies: 1 comment
-
Just in case this has not been answered yet group=app.add_option_group("subgroup");
group->add_flag("--cpu", isOnCpu, "Run the computation on the CPU")->ignore_case();
group->add_flag("--gpu", isOnGpu, "Run the computation on the GPU")->ignore_case();
group->require_option(1); The require_option(1) will state that 1 and only 1 option from the group is required. Any more or less is an error. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is a follow-up question from here. It seems this is not [clearly?] discussed in the documentations. so here it is again, How can we have two required mutually exclusive options in CLI11?
Beta Was this translation helpful? Give feedback.
All reactions