aboutsummaryrefslogtreecommitdiff
path: root/Documentation/technical
diff options
context:
space:
mode:
authorPranit Bauva <pranit.bauva@gmail.com>2016-03-25 18:58:58 +0000
committerJunio C Hamano <gitster@pobox.com>2016-03-25 13:17:43 -0700
commitc3f6b853bfafa2046f2c6b0b9661d284436900b6 (patch)
tree9fda7a53af06a7ecb92f4c174d555df5a61cd9d4 /Documentation/technical
parente46579643d56162299b1756b70d418005351b256 (diff)
downloadgit-c3f6b853bfafa2046f2c6b0b9661d284436900b6.tar.gz
git-c3f6b853bfafa2046f2c6b0b9661d284436900b6.tar.xz
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 <pranit.bauva@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/technical')
-rw-r--r--Documentation/technical/api-parse-options.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/Documentation/technical/api-parse-options.txt b/Documentation/technical/api-parse-options.txt
index 5f0757dcc..695bd4bf4 100644
--- a/Documentation/technical/api-parse-options.txt
+++ b/Documentation/technical/api-parse-options.txt
@@ -231,6 +231,13 @@ There are some macros to easily define options:
pass the command-line option, which can be specified multiple times,
to another command.
+`OPT_CMDMODE(short, long, &int_var, description, enum_val)`::
+ Define an "operation 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`.
+
The last element of the array must be `OPT_END()`.