git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Martin Ågren" <martin.agren@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Patrick Steinhardt <ps@pks.im>, git@vger.kernel.org
Subject: Re: [RFC] usage_msg_opt() and _optf() must die
Date: Tue, 6 Aug 2024 21:24:17 +0200	[thread overview]
Message-ID: <CAN0heSpAVinS8tuUr-o4Js3SymP_aFRpQgTVZYVVtJHVoL-uxw@mail.gmail.com> (raw)
In-Reply-To: <xmqqmslptw3u.fsf_-_@gitster.g>

On Tue, 6 Aug 2024 at 19:11, Junio C Hamano <gitster@pobox.com> wrote:
> 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

  parent reply	other threads:[~2024-08-06 19:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-06  0:35 [PATCH v1 0/4] make "too many arguments" a bit more useful Junio C Hamano
2024-08-06  0:35 ` [PATCH v1 1/4] refs: avoid "too many arguments" Junio C Hamano
2024-08-06  6:13   ` Patrick Steinhardt
2024-08-06 16:48     ` Junio C Hamano
2024-08-06 17:11       ` [RFC] usage_msg_opt() and _optf() must die Junio C Hamano
2024-08-06 17:38         ` Eric Sunshine
2024-08-06 20:21           ` Junio C Hamano
2024-08-07  5:01             ` Patrick Steinhardt
2024-08-06 19:09         ` Justin Tobler
2024-08-06 19:24         ` Martin Ågren [this message]
2024-08-06 17:47   ` [PATCH v2] refs: avoid "too many arguments" Junio C Hamano
2024-08-06  0:35 ` [PATCH v1 2/4] cat-file: " Junio C Hamano
2024-08-06  0:35 ` [PATCH v1 3/4] notes: " Junio C Hamano
2024-08-06  0:35 ` [PATCH v1 4/4] miscellaneous: " Junio C Hamano
2024-08-06  2:31   ` Eric Sunshine
2024-08-06 16:50     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAN0heSpAVinS8tuUr-o4Js3SymP_aFRpQgTVZYVVtJHVoL-uxw@mail.gmail.com \
    --to=martin.agren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ps@pks.im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).