Re: [PATCH v3 2/4] parse-options: add a separate case for help output on error
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 8, 2026, 01:26 UTC
- Message-ID
- <xmqqmrw2xoet.fsf@gitster.g>
- In-Reply-To
- <20260708001557.3581080-3-sandals@crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 6 quoted lines
> @@ -1363,7 +1368,7 @@ static enum parse_opt_result usage_with_options_internal(struct parse_opt_ctx_t > parse_options_check_harder(opts); > > if (!usagestr) > - return PARSE_OPT_HELP; > + return err ? PARSE_OPT_HELP_ERROR : PARSE_OPT_HELP;
This part, IIUC, got updated from the previous round. Looks sensible.
Show 7 quoted lines
> @@ -1476,7 +1481,7 @@ static enum parse_opt_result usage_with_options_internal(struct parse_opt_ctx_t
> if (!err && ctx && ctx->flags & PARSE_OPT_SHELL_EVAL)
> fputs("EOF\n", outfile);
>
> - return PARSE_OPT_HELP;
> + return err ? PARSE_OPT_HELP_ERROR : PARSE_OPT_HELP;
> }And the above matches this part, of course.