Skip to content

Commit e78d01b

Browse files
tfarinagitster
authored andcommitted
builtin/merge_recursive.c: Add an usage string and make use of it.
This improves the usage output by adding builtin_merge_recursive_usage string that follows the same pattern used by the other builtin commands. The previous output for git merger-recursive was: usage: merge-recursive <base>... -- <head> <remote> ... Now the output is: usage: git merge-recursive <base>... -- <head> <remote> ... Since cmd_merge_recursive is used to handle four different commands we need the %s in the usage string, so the following example: $ git merge-subtree -h Will output: usage: git merge-subtree <base>... -- <head> <remote> ... Signed-off-by: Thiago Farina <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 22da742 commit e78d01b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

builtin/merge-recursive.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#include "tag.h"
44
#include "merge-recursive.h"
55

6+
static const char builtin_merge_recursive_usage[] =
7+
"git %s <base>... -- <head> <remote> ...";
8+
69
static const char *better_branch_name(const char *branch)
710
{
811
static char githead_env[8 + 40 + 1];
@@ -29,7 +32,7 @@ int cmd_merge_recursive(int argc, const char **argv, const char *prefix)
2932
o.subtree_shift = "";
3033

3134
if (argc < 4)
32-
usagef("%s <base>... -- <head> <remote> ...", argv[0]);
35+
usagef(builtin_merge_recursive_usage, argv[0]);
3336

3437
for (i = 1; i < argc; ++i) {
3538
const char *arg = argv[i];

0 commit comments

Comments
 (0)