Merge branch 'rs/merge-microcleanup'
[gitweb.git] / Documentation / technical / api-parse-options.txt
index 695bd4bf43255e42ef26d29a5c6dff35217f220d..829b5581105468d4d3b457e60b10cdbdf317fbbc 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.
@@ -164,6 +168,11 @@ There are some macros to easily define options:
        Introduce an option with string argument.
        The string argument is put into `str_var`.
 
+`OPT_STRING_LIST(short, long, &struct string_list, arg_str, description)`::
+       Introduce an option with string argument.
+       The string argument is stored as an element in `string_list`.
+       Use of `--no-option` will clear the list of preceding values.
+
 `OPT_INTEGER(short, long, &int_var, description)`::
        Introduce an option with integer argument.
        The integer is put into `int_var`.
@@ -174,13 +183,13 @@ There are some macros to easily define options:
        scale the provided value by 1024, 1024^2 or 1024^3 respectively.
        The scaled value is put into `unsigned_long_var`.
 
-`OPT_DATE(short, long, &int_var, description)`::
+`OPT_DATE(short, long, &timestamp_t_var, description)`::
        Introduce an option with date argument, see `approxidate()`.
-       The timestamp is put into `int_var`.
+       The timestamp is put into `timestamp_t_var`.
 
-`OPT_EXPIRY_DATE(short, long, &int_var, description)`::
+`OPT_EXPIRY_DATE(short, long, &timestamp_t_var, description)`::
        Introduce an option with expiry date argument, see `parse_expiry_date()`.
-       The timestamp is put into `int_var`.
+       The timestamp is put into `timestamp_t_var`.
 
 `OPT_CALLBACK(short, long, &var, arg_str, description, func_ptr)`::
        Introduce an option with argument.