Re: [RFC] usage_msg_opt() and _optf() must die
- From
- Martin Ågren <martin.agren@gmail.com>
- Date
- Aug 6, 2024, 19:24 UTC
- Message-ID
- <CAN0heSpAVinS8tuUr-o4Js3SymP_aFRpQgTVZYVVtJHVoL-uxw@mail.gmail.com>
- In-Reply-To
- <xmqqmslptw3u.fsf_-_@gitster.g>
On Tue, 6 Aug 2024 at 19:11, Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
> I am very much tempted to suggest us do this.
>
> void NORETURN usage_msg_opt(const char *msg,
> - const char * const *usagestr,
> - const struct option *options)
> + const char * const *usagestr UNUSED,
> + const struct option *options UNUSED)
> {
> - die_message("%s\n", msg); /* The extra \n is intentional */
> - usage_with_options(usagestr, options);
> + die("%s", msg);
> }Yes, I'm very much in favor of this. I know I've been greeted by a wall of usage text more than once and it does feel kind of intimidating.
I just tested this using a silly
git clone a b c d e f
and the user experience is so much better after this patch. It's simply "fatal: Too many arguments.", which is kind of neat, all things considered. While one can always polish each error message individually, hiding it behind a big usage dump feels wrong.
Martin