]> git.ipfire.org Git - thirdparty/git.git/commit
api-parse-options.adoc: document per-option flags
authorChristian Couder <christian.couder@gmail.com>
Thu, 16 Jul 2026 16:55:12 +0000 (18:55 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Jul 2026 21:11:12 +0000 (14:11 -0700)
commitbdc8088f44fa9e289ad8714d1c8a29a0001f4239
treea1ac1804097946c041830a9b6bf17338b272fdf0
parente8529cc8da9437e6b7bf958192ca0984103b43c1
api-parse-options.adoc: document per-option flags

The "Flags" section in "Documentation/technical/api-parse-options.adoc"
documents the flags that can be passed to parse_options() itself. It
does not, however, document the flags that can be set on individual
options through the `flags` member of `struct option` (and through the
`OPT_*_F()` macro variants).

These per-option flags are used throughout the codebase (for example
`PARSE_OPT_HIDDEN` is used to hide an option from `-h` while still
showing it with `--help-all`), but a reader currently has to dig into
"parse-options.h" to find them.

To remediate that, let's add an "Option flags" subsection to the
"Data Structure" section, just before the list of option macros.

Let's also make it explicit that these are distinct from the
parse_options() flags described earlier, and let's describe the `-h`
versus `--help-all` behavior for `PARSE_OPT_HIDDEN`.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/technical/api-parse-options.adoc