Merge branch 'jk/avoid-unbounded-alloca'
[gitweb.git] / Documentation / technical / api-parse-options.txt
index 695bd4bf43255e42ef26d29a5c6dff35217f220d..27bd701c0d6862f38c700fbfc02c24b135bd6c0e 100644 (file)
@@ -144,8 +144,12 @@ There are some macros to easily define options:
 
 `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`.
+       Each use of `--option` increments `int_var`, starting from zero
+       (even if initially negative), and `--no-option` resets it to
+       zero. To determine if `--option` or `--no-option` was encountered at
+       all, initialize `int_var` to a negative value, and if it is still
+       negative after parse_options(), then neither `--option` nor
+       `--no-option` was seen.
 
 `OPT_BIT(short, long, &int_var, description, mask)`::
        Introduce a boolean option.