diff options
author | SZEDER Gábor <szeder.dev@gmail.com> | 2022-08-19 16:03:57 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-08-19 18:13:14 (GMT) |
commit | 99d86d60e59e11cbc46766346e3e379164a6e4df (patch) | |
tree | 01d48b5ff8a6815654379ac8f3ddf939e6b8b9f9 /Documentation/technical/api-parse-options.txt | |
parent | 80882bc5e7143a0c3823b5a398fd76c9138437ef (diff) | |
download | git-99d86d60e59e11cbc46766346e3e379164a6e4df.zip git-99d86d60e59e11cbc46766346e3e379164a6e4df.tar.gz git-99d86d60e59e11cbc46766346e3e379164a6e4df.tar.bz2 |
parse-options: PARSE_OPT_KEEP_UNKNOWN only applies to --options
The description of 'PARSE_OPT_KEEP_UNKNOWN' starts with "Keep unknown
arguments instead of erroring out". This is a bit misleading, as this
flag only applies to unknown --options, while non-option arguments are
kept even without this flag.
Update the description to clarify this, and rename the flag to
PARSE_OPTIONS_KEEP_UNKNOWN_OPT to make this obvious just by looking at
the flag name.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/technical/api-parse-options.txt')
-rw-r--r-- | Documentation/technical/api-parse-options.txt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Documentation/technical/api-parse-options.txt b/Documentation/technical/api-parse-options.txt index 5a04f3d..4412377 100644 --- a/Documentation/technical/api-parse-options.txt +++ b/Documentation/technical/api-parse-options.txt @@ -90,8 +90,8 @@ Flags are the bitwise-or of: Keep the first argument, which contains the program name. It's removed from argv[] by default. -`PARSE_OPT_KEEP_UNKNOWN`:: - Keep unknown arguments instead of erroring out. This doesn't +`PARSE_OPT_KEEP_UNKNOWN_OPT`:: + Keep unknown options instead of erroring out. This doesn't work for all combinations of arguments as users might expect it to do. E.g. if the first argument in `--unknown --known` takes a value (which we can't know), the second one is @@ -101,6 +101,8 @@ Flags are the bitwise-or of: non-option, not as a value belonging to the unknown option, the parser early. That's why parse_options() errors out if both options are set. + Note that non-option arguments are always kept, even without + this flag. `PARSE_OPT_NO_INTERNAL_HELP`:: By default, parse_options() handles `-h`, `--help` and |