diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-10-12 12:34:15 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-12 12:34:15 -0700 |
commit | af543833d4e10163af8045859cc081969fa5fcec (patch) | |
tree | 8d131837c007202fa2e733996c8b5384fe73bde5 /Documentation/technical | |
parent | Merge branch 'rs/test-ctype' (diff) | |
parent | apply: use OPT_NOOP_NOARG (diff) | |
download | tgif-af543833d4e10163af8045859cc081969fa5fcec.tar.xz |
Merge branch 'jc/parse-options-boolean'
* jc/parse-options-boolean:
apply: use OPT_NOOP_NOARG
revert: use OPT_NOOP_NOARG
parseopt: add OPT_NOOP_NOARG
archive.c: use OPT_BOOL()
parse-options: deprecate OPT_BOOLEAN
Conflicts:
builtin/revert.c
Diffstat (limited to 'Documentation/technical')
-rw-r--r-- | Documentation/technical/api-parse-options.txt | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/Documentation/technical/api-parse-options.txt b/Documentation/technical/api-parse-options.txt index f6a4a361bd..4b92514f60 100644 --- a/Documentation/technical/api-parse-options.txt +++ b/Documentation/technical/api-parse-options.txt @@ -135,9 +135,14 @@ There are some macros to easily define options: describes the group or an empty string. Start the description with an upper-case letter. -`OPT_BOOLEAN(short, long, &int_var, description)`:: - Introduce a boolean option. - `int_var` is incremented on each use. +`OPT_BOOL(short, long, &int_var, description)`:: + Introduce a boolean option. `int_var` is set to one with + `--option` and set to zero with `--no-option`. + +`OPT_COUNTUP(short, long, &int_var, description)`:: + Introduce a count-up option. + `int_var` is incremented on each use of `--option`, and + reset to zero with `--no-option`. `OPT_BIT(short, long, &int_var, description, mask)`:: Introduce a boolean option. @@ -148,8 +153,9 @@ There are some macros to easily define options: If used, `int_var` is bitwise-anded with the inverted `mask`. `OPT_SET_INT(short, long, &int_var, description, integer)`:: - Introduce a boolean option. - If used, set `int_var` to `integer`. + Introduce an integer option. + `int_var` is set to `integer` with `--option`, and + reset to zero with `--no-option`. `OPT_SET_PTR(short, long, &ptr_var, description, ptr)`:: Introduce a boolean option. @@ -198,6 +204,11 @@ There are some macros to easily define options: "auto", set `int_var` to 1 if stdout is a tty or a pager, 0 otherwise. +`OPT_NOOP_NOARG(short, long)`:: + Introduce an option that has no effect and takes no arguments. + Use it to hide deprecated options that are still to be recognized + and ignored silently. + The last element of the array must be `OPT_END()`. |