Junio C Hamano
a36a822d7d
oddballs: send usage() help text to standard output
...
Using the show_usage_if_asked() helper we introduced earlier, fix
callers of usage() that want to show the help text when explicitly
asked by the end-user. The help text now goes to the standard
output stream for them.
The callers in this step are oddballs in that their invocations of
usage() are *not* guarded by
if (argc == 2 && !strcmp(argv[1], "-h")
usage(...);
There are (unnecessarily) being clever ones that do things like
if (argc != 2 || !strcmp(argv[1], "-h")
usage(...);
to say "I know I take only one argument, so argc != 2 is always an
error regardless of what is in argv[]. Ah, by the way, even if argc
is 2, "-h" is a request for usage text, so we do the same".
Some like "git var -h" just do not treat "-h" any specially, and let
it take the same error code paths as a parameter error.
Now we cannot do the same, so these callers are rewrittin to do the
show_usage_and_exit_if_asked() first and then handle the usage error
the way they used to.
Acked-by: Jeff King <peff@peff.net >
Signed-off-by: Junio C Hamano <gitster@pobox.com >
2025-01-17 13:30:03 -08:00
..
2024-12-06 20:20:04 +09:00
2025-01-17 13:30:03 -08:00
2024-10-25 14:02:36 -04:00
2024-09-13 14:32:24 -07:00
2024-10-11 09:37:18 -07:00
2024-12-06 20:20:02 +09:00
2025-01-10 06:56:55 -08:00
2025-01-17 13:30:03 -08:00
2024-09-13 14:32:24 -07:00
2024-12-13 07:33:36 -08:00
2024-12-23 09:32:11 -08:00
2024-09-13 14:32:24 -07:00
2024-09-13 14:32:24 -07:00
2024-09-23 10:35:09 -07:00
2024-12-03 12:38:49 +09:00
2025-01-17 13:30:03 -08:00
2025-01-17 13:30:03 -08:00
2024-12-23 09:32:11 -08:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:02 +09:00
2024-09-13 14:32:24 -07:00
2024-11-26 10:36:08 +09:00
2025-01-17 13:30:03 -08:00
2025-01-17 13:30:03 -08:00
2024-11-26 10:36:08 +09:00
2024-12-04 08:21:54 +09:00
2024-09-13 14:32:24 -07:00
2024-11-01 12:53:19 -04:00
2024-09-13 14:32:24 -07:00
2025-01-17 13:30:03 -08:00
2024-12-23 09:32:11 -08:00
2024-09-13 14:33:30 -07:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:03 +09:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:04 +09:00
2024-12-06 20:20:02 +09:00
2025-01-01 09:21:14 -08:00
2025-01-17 13:30:03 -08:00
2025-01-06 12:02:21 -08:00
2024-09-23 10:35:09 -07:00
2024-09-23 10:35:09 -07:00
2024-12-06 20:20:04 +09:00
2024-12-04 08:21:54 +09:00
2025-01-17 13:30:03 -08:00
2025-01-17 13:30:03 -08:00
2024-09-13 14:33:30 -07:00
2025-01-01 14:13:01 -08:00
2024-09-13 14:32:24 -07:00
2024-12-06 20:20:04 +09:00
2024-11-26 10:36:08 +09:00
2025-01-01 14:13:01 -08:00
2024-11-21 08:23:45 +09:00
2024-10-14 12:33:02 -04:00
2024-12-23 09:32:11 -08:00
2025-01-17 13:30:03 -08:00
2024-11-04 22:37:51 -08:00
2024-09-13 14:32:24 -07:00
2024-09-13 14:32:24 -07:00
2024-12-06 20:20:04 +09:00
2024-09-13 14:32:24 -07:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:03 +09:00
2024-09-13 14:32:24 -07:00
2024-12-06 20:20:04 +09:00
2025-01-17 13:30:03 -08:00
2024-09-13 14:32:24 -07:00
2024-09-13 14:32:24 -07:00
2024-12-04 10:32:20 +09:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:02 +09:00
2024-11-26 10:36:08 +09:00
2024-12-23 09:32:11 -08:00
2024-12-23 09:32:11 -08:00
2024-12-06 20:20:03 +09:00
2024-12-06 20:20:05 +09:00
2024-09-13 14:33:30 -07:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:04 +09:00
2024-12-06 20:20:04 +09:00
2024-12-23 09:32:17 -08:00
2024-09-13 14:32:24 -07:00
2025-01-17 13:30:03 -08:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:03 +09:00
2024-12-04 10:14:47 +09:00
2024-09-13 14:33:30 -07:00
2024-09-13 14:33:30 -07:00
2024-12-23 09:32:11 -08:00
2024-12-23 09:32:11 -08:00
2024-11-21 07:59:14 +09:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:04 +09:00
2024-12-06 20:20:03 +09:00
2024-12-23 09:32:11 -08:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:03 +09:00
2024-12-06 20:20:02 +09:00
2024-09-30 11:23:09 -07:00
2024-12-06 20:20:03 +09:00
2024-12-06 20:20:02 +09:00
2024-12-23 09:32:12 -08:00
2024-09-13 14:32:24 -07:00
2024-12-06 20:20:02 +09:00
2024-12-06 20:20:04 +09:00
2024-09-13 14:32:24 -07:00
2024-12-06 20:20:04 +09:00
2024-09-13 14:32:24 -07:00
2024-12-23 09:32:11 -08:00
2025-01-17 13:30:03 -08:00
2024-12-06 20:20:02 +09:00
2025-01-17 13:30:03 -08:00
2024-12-06 20:20:02 +09:00
2024-09-13 14:32:24 -07:00
2025-01-17 13:30:03 -08:00
2024-12-10 10:04:55 +09:00
2025-01-17 13:30:03 -08:00
2024-09-13 14:32:24 -07:00
2024-09-13 14:32:24 -07:00
2024-09-23 10:35:09 -07:00
2024-12-23 09:32:11 -08:00
2024-09-23 10:35:09 -07:00