Make git status usage say git status instead of git commit
git status shares the same usage information as git commit since it shows what would be committed if the same options are given. However, when displaying the usage information for git status it should say it is for git status not git commit. Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Shawn Bohrer committed
Dec 2, 2007 at 23:02 UTC
2f02b25f36bce23e6b65c5112876796a56e084ca
1 file changed
+10
-5
builtin-commit.c
+10
-5
@@ -27,6 +27,11 @@ static const char * const builtin_commit_usage[] = {
27
NULL
28
};
29
30
+static const char * const builtin_status_usage[] = {
31
+ "git-status [options] [--] <filepattern>...",
32
+ NULL
33
+};
34
+
35
static unsigned char head_sha1[20], merge_head_sha1[20];
36
static char *use_message_buffer;
37
static const char commit_editmsg[] = "COMMIT_EDITMSG";
@@ -493,12 +498,12 @@ static void determine_author_info(struct strbuf *sb)
498
strbuf_addf(sb, "author %s\n", fmt_ident(name, email, date, 1));
499
}
500
496
-static int parse_and_validate_options(int argc, const char *argv[])
501
+static int parse_and_validate_options(int argc, const char *argv[],
502
+ const char * const usage[])
503
{
504
int f = 0;
505
500
- argc = parse_options(argc, argv, builtin_commit_options,
501
- builtin_commit_usage, 0);
506
+ argc = parse_options(argc, argv, builtin_commit_options, usage, 0);
507
508
if (logfile || message.len || use_message)
509
no_edit = 1;
@@ -595,7 +600,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
600
601
git_config(git_status_config);
602
598
- argc = parse_and_validate_options(argc, argv);
603
+ argc = parse_and_validate_options(argc, argv, builtin_status_usage);
604
605
index_file = prepare_index(argv, prefix);
606
@@ -687,7 +692,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
692
693
git_config(git_commit_config);
694
690
- argc = parse_and_validate_options(argc, argv);
695
+ argc = parse_and_validate_options(argc, argv, builtin_commit_usage);
696
697
index_file = prepare_index(argv, prefix);
698