Does anyone know how to specify mutually exclusive options with argp in C
? Is there any trick one could use?
EDIT
What are mutually exclusive options?
Say you have some command line utility
. You type utility --help
and the output looks like this
utility [-a|-b]
Options -a
and -b
are mutually exclusive because one cannot specify them together, i.e. specifying -a
excludes the use of -b
. The same holds for -b
. If it is used then one cannot specify -a
. In other words only the following is possible:
utility -a
or utility -b
.
From the argp documentation it doesn't seem that it is possible to specify this kind of option. So the question is what tricks do people use to specify this kind of option? I'm sure the need to this arose more than once in someone's experience.