aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/upload-archive.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-01-28 13:02:22 -0800
committerJunio C Hamano <gitster@pobox.com>2025-01-28 13:02:22 -0800
commitf0a371a39d8b9945b2e0a414a32aa861614e5352 (patch)
tree5ee935ae11355384d47bc2da81d6a19bf2ae15cb /builtin/upload-archive.c
parent5f8f7081f7761acdf83d0a4c6819fe3d724f01d7 (diff)
parentf66d1423f528403a33e8984f765801deb1b9cb97 (diff)
downloadgit-f0a371a39d8b9945b2e0a414a32aa861614e5352.tar.gz
Merge branch 'jc/show-usage-help'
The help text from "git $cmd -h" appear on the standard output for some $cmd and the standard error for others. The built-in commands have been fixed to show them on the standard output consistently. * jc/show-usage-help: builtin: send usage() help text to standard output oddballs: send usage() help text to standard output builtins: send usage_with_options() help text to standard output usage: add show_usage_if_asked() parse-options: add show_usage_with_options_if_asked() t0012: optionally check that "-h" output goes to stdout
Diffstat (limited to 'builtin/upload-archive.c')
-rw-r--r--builtin/upload-archive.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/upload-archive.c b/builtin/upload-archive.c
index 9e9343f121..97d7c9522f 100644
--- a/builtin/upload-archive.c
+++ b/builtin/upload-archive.c
@@ -27,7 +27,8 @@ int cmd_upload_archive_writer(int argc,
const char *arg_cmd = "argument ";
int ret;
- if (argc != 2 || !strcmp(argv[1], "-h"))
+ show_usage_if_asked(argc, argv, upload_archive_usage);
+ if (argc != 2)
usage(upload_archive_usage);
if (!enter_repo(argv[1], 0))
@@ -92,8 +93,7 @@ struct repository *repo UNUSED)
BUG_ON_NON_EMPTY_PREFIX(prefix);
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage(upload_archive_usage);
+ show_usage_if_asked(argc, argv, upload_archive_usage);
/*
* Set up sideband subprocess.