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

From: Junio C Hamano <[email-masked]>
Date: Tue, 06 Aug 2024 10:11:17 -0700

Junio C Hamano <[email-masked]> writes:

> Patrick Steinhardt <[email-masked]> 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,