Re: [RFC] usage_msg_opt() and _optf() must die

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux