Skip to content

Commit c3f6b85

Browse files
pranitbauva1997gitster
authored andcommitted
api-parse-options.txt: document OPT_CMDMODE()
OPT_CMDMODE mechanism was introduced in the release of 1.8.5 to actively notice when multiple "operation mode" options that specify mutually incompatible operation modes are given. Signed-off-by: Pranit Bauva <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e465796 commit c3f6b85

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Documentation/technical/api-parse-options.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,13 @@ There are some macros to easily define options:
231231
pass the command-line option, which can be specified multiple times,
232232
to another command.
233233

234+
`OPT_CMDMODE(short, long, &int_var, description, enum_val)`::
235+
Define an "operation mode" option, only one of which in the same
236+
group of "operating mode" options that share the same `int_var`
237+
can be given by the user. `enum_val` is set to `int_var` when the
238+
option is used, but an error is reported if other "operating mode"
239+
option has already set its value to the same `int_var`.
240+
234241

235242
The last element of the array must be `OPT_END()`.
236243

0 commit comments

Comments
 (0)