Subject: Re: [PATCH] api-parse-options.txt: document OPT_CMDMODE()

From: Junio C Hamano <[email-masked]>
Date: Thu, 24 Mar 2016 10:16:31 -0700

Pranit Bauva <[email-masked]> writes:

>>> +`OPT_CMDMODE(short, long, &int_var, description, enum_val)`::
>>> +     Introduce an option for subcommands. It is useful when you want to use
>>> +     the command with a particular sub command only and ignore other sub
>>> +     commands it has. It will set `int_var` to enum_val if the argument is
>>> +     invoked.
>>> +
>>
>> Sorry, but I do not get what "when you want to... ignore other sub
>> command it has" wants to say.
>
> What I meant by this statement is that (your example), let's say we
> have "add", "remove" and "edit" sub commands. Now the user has to pick
> between the three. He cannot choose more than 1 from these.

Then I find the word "ignore others" misleading.  Quite the
contrary, the user has to be aware of the others and not to give
them.

	Define an "operating mode" option, only one of which in the
	same group of "operating mode" options that share the same
	`int_var` can be given by the user.  `enum_val` is set to
	`int_var` when the option is used, but an error is reported
        if other "operating mode" option has already set its value
        to the same `int_var`.

or something?