diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-01-28 13:02:22 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-01-28 13:02:22 -0800 |
| commit | f0a371a39d8b9945b2e0a414a32aa861614e5352 (patch) | |
| tree | 5ee935ae11355384d47bc2da81d6a19bf2ae15cb /builtin/merge-index.c | |
| parent | 5f8f7081f7761acdf83d0a4c6819fe3d724f01d7 (diff) | |
| parent | f66d1423f528403a33e8984f765801deb1b9cb97 (diff) | |
| download | git-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/merge-index.c')
| -rw-r--r-- | builtin/merge-index.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/builtin/merge-index.c b/builtin/merge-index.c index 342699edb7..3314fb1336 100644 --- a/builtin/merge-index.c +++ b/builtin/merge-index.c @@ -75,6 +75,9 @@ static void merge_all(void) } } +static const char usage_string[] = +"git merge-index [-o] [-q] <merge-program> (-a | [--] [<filename>...])"; + int cmd_merge_index(int argc, const char **argv, const char *prefix UNUSED, @@ -87,8 +90,10 @@ int cmd_merge_index(int argc, */ signal(SIGCHLD, SIG_DFL); + show_usage_if_asked(argc, argv, usage_string); + if (argc < 3) - usage("git merge-index [-o] [-q] <merge-program> (-a | [--] [<filename>...])"); + usage(usage_string); repo_read_index(the_repository); |
