Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-03-02 23:44:06 +0300
committerJunio C Hamano <gitster@pobox.com>2010-03-02 23:44:06 +0300
commitc06951894ac943b2aaa288b0e9dc1eb605dfb7b6 (patch)
treec84152355c7fe666d0bb16197e36eb63e33e0c13 /Documentation/technical
parent6954ef206343d366c365f5946caa967f92d7bab1 (diff)
parent73e9da019655261e456ed862340880de365111f0 (diff)
Merge branch 'ml/color-when'
* ml/color-when: Add an optional argument for --color options
Diffstat (limited to 'Documentation/technical')
-rw-r--r--Documentation/technical/api-parse-options.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/Documentation/technical/api-parse-options.txt b/Documentation/technical/api-parse-options.txt
index 50f9e9ac17..312e3b2e2b 100644
--- a/Documentation/technical/api-parse-options.txt
+++ b/Documentation/technical/api-parse-options.txt
@@ -115,6 +115,9 @@ There are some macros to easily define options:
`OPT__ABBREV(&int_var)`::
Add `\--abbrev[=<n>]`.
+`OPT__COLOR(&int_var, description)`::
+ Add `\--color[=<when>]` and `--no-color`.
+
`OPT__DRY_RUN(&int_var)`::
Add `-n, \--dry-run`.
@@ -183,6 +186,15 @@ There are some macros to easily define options:
arguments. Short options that happen to be digits take
precedence over it.
+`OPT_COLOR_FLAG(short, long, &int_var, description)`::
+ Introduce an option that takes an optional argument that can
+ have one of three values: "always", "never", or "auto". If the
+ argument is not given, it defaults to "always". The `--no-` form
+ works like `--long=never`; it cannot take an argument. If
+ "always", set `int_var` to 1; if "never", set `int_var` to 0; if
+ "auto", set `int_var` to 1 if stdout is a tty or a pager,
+ 0 otherwise.
+
The last element of the array must be `OPT_END()`.