Structopt 'exactly one of'

Using StructOpt, is it possible to express a constraint that you have a set of arguments where you can only specify exactly one? For example, pacman operations where you can say "-S" or "-R" but not both. I'm aware of subcommands, but as far as I can tell, they can't be used as switches

clap allows arguments in an ArgGroup to conflict with each other:

You may be able to adapt the example at to use it with structopt.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.