aboutsummaryrefslogtreecommitdiff
path: root/builtin-commit.c
diff options
context:
space:
mode:
authorShawn Bohrer <shawn.bohrer@gmail.com>2007-12-02 23:02:09 -0600
committerJunio C Hamano <gitster@pobox.com>2007-12-02 23:35:46 -0800
commit2f02b25f36bce23e6b65c5112876796a56e084ca (patch)
tree794d54f0d48d2d85914eb8322108d71909015b3f /builtin-commit.c
parentd9ccfe7711a8bf1ed9d9cd87daa9863e0d564b23 (diff)
downloadgit-2f02b25f36bce23e6b65c5112876796a56e084ca.tar.gz
git-2f02b25f36bce23e6b65c5112876796a56e084ca.tar.xz
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>
Diffstat (limited to 'builtin-commit.c')
-rw-r--r--builtin-commit.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/builtin-commit.c b/builtin-commit.c
index 05594f2b1..f37a90f07 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -27,6 +27,11 @@ static const char * const builtin_commit_usage[] = {
NULL
};
+static const char * const builtin_status_usage[] = {
+ "git-status [options] [--] <filepattern>...",
+ NULL
+};
+
static unsigned char head_sha1[20], merge_head_sha1[20];
static char *use_message_buffer;
static const char commit_editmsg[] = "COMMIT_EDITMSG";
@@ -493,12 +498,12 @@ static void determine_author_info(struct strbuf *sb)
strbuf_addf(sb, "author %s\n", fmt_ident(name, email, date, 1));
}
-static int parse_and_validate_options(int argc, const char *argv[])
+static int parse_and_validate_options(int argc, const char *argv[],
+ const char * const usage[])
{
int f = 0;
- argc = parse_options(argc, argv, builtin_commit_options,
- builtin_commit_usage, 0);
+ argc = parse_options(argc, argv, builtin_commit_options, usage, 0);
if (logfile || message.len || use_message)
no_edit = 1;
@@ -595,7 +600,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
git_config(git_status_config);
- argc = parse_and_validate_options(argc, argv);
+ argc = parse_and_validate_options(argc, argv, builtin_status_usage);
index_file = prepare_index(argv, prefix);
@@ -687,7 +692,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
git_config(git_commit_config);
- argc = parse_and_validate_options(argc, argv);
+ argc = parse_and_validate_options(argc, argv, builtin_commit_usage);
index_file = prepare_index(argv, prefix);