From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org
Subject: [RFC] usage_msg_opt() and _optf() must die
Date: Tue, 06 Aug 2024 10:11:17 -0700 [thread overview]
Message-ID: <xmqqmslptw3u.fsf_-_@gitster.g> (raw)
In-Reply-To: <xmqqed71vbps.fsf@gitster.g> (Junio C. Hamano's message of "Tue, 06 Aug 2024 09:48:47 -0700")
Junio C Hamano <gitster@pobox.com> writes:
> Patrick Steinhardt <ps@pks.im> writes:
>
>> I always have to wonder how helpful it really is to print the usage
>> information in such a context. I feel that it is too distracting because
>> in many cases, we end up printing dozens of lines of options that drown
>> out the single line of information that the user actually cares for,
>> namely why the command has failed.
Yes. I do not think I found it useful to give the single-line
message, blank line, followed by the full usage text even a single
time myself.
I am very much tempted to suggest us do this.
parse-options.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git c/parse-options.c w/parse-options.c
index 30b9e68f8a..f27c425557 100644
--- c/parse-options.c
+++ w/parse-options.c
@@ -1277,11 +1277,10 @@ void NORETURN usage_with_options(const char * const *usagestr,
}
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);
}
void NORETURN usage_msg_optf(const char * const fmt,
next prev parent reply other threads:[~2024-08-06 17:11 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 ` Junio C Hamano [this message]
2024-08-06 17:38 ` [RFC] usage_msg_opt() and _optf() must die 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
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=xmqqmslptw3u.fsf_-_@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.