diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/branch.c | 3 | ||||
-rw-r--r-- | builtin/checkout-index.c | 3 | ||||
-rw-r--r-- | builtin/commit.c | 6 | ||||
-rw-r--r-- | builtin/gc.c | 3 | ||||
-rw-r--r-- | builtin/ls-files.c | 3 | ||||
-rw-r--r-- | builtin/merge.c | 3 | ||||
-rw-r--r-- | builtin/update-index.c | 3 |
7 files changed, 24 insertions, 0 deletions
diff --git a/builtin/branch.c b/builtin/branch.c index 807355a198..0cad20bb5a 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -668,6 +668,9 @@ int cmd_branch(int argc, const char **argv, const char *prefix) OPT_END(), }; + if (argc == 2 && !strcmp(argv[1], "-h")) + usage_with_options(builtin_branch_usage, options); + git_config(git_branch_config, NULL); if (branch_use_color == -1) diff --git a/builtin/checkout-index.c b/builtin/checkout-index.c index 1ee3044307..f1fec24745 100644 --- a/builtin/checkout-index.c +++ b/builtin/checkout-index.c @@ -241,6 +241,9 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix) OPT_END() }; + if (argc == 2 && !strcmp(argv[1], "-h")) + usage_with_options(builtin_checkout_index_usage, + builtin_checkout_index_options); git_config(git_default_config, NULL); state.base_dir = ""; prefix_length = prefix ? strlen(prefix) : 0; diff --git a/builtin/commit.c b/builtin/commit.c index 6d867d4018..c045c9ef8c 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1097,6 +1097,9 @@ int cmd_status(int argc, const char **argv, const char *prefix) OPT_END(), }; + if (argc == 2 && !strcmp(argv[1], "-h")) + usage_with_options(builtin_status_usage, builtin_status_options); + if (null_termination && status_format == STATUS_FORMAT_LONG) status_format = STATUS_FORMAT_PORCELAIN; @@ -1282,6 +1285,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix) int allow_fast_forward = 1; struct wt_status s; + if (argc == 2 && !strcmp(argv[1], "-h")) + usage_with_options(builtin_commit_usage, builtin_commit_options); + wt_status_prepare(&s); git_config(git_commit_config, &s); in_merge = file_exists(git_path("MERGE_HEAD")); diff --git a/builtin/gc.c b/builtin/gc.c index 397a1e6eb3..1a80702b3d 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -189,6 +189,9 @@ int cmd_gc(int argc, const char **argv, const char *prefix) OPT_END() }; + if (argc == 2 && !strcmp(argv[1], "-h")) + usage_with_options(builtin_gc_usage, builtin_gc_options); + git_config(gc_config, NULL); if (pack_refs < 0) diff --git a/builtin/ls-files.c b/builtin/ls-files.c index 6a307ab784..fb2d5f4b1f 100644 --- a/builtin/ls-files.c +++ b/builtin/ls-files.c @@ -530,6 +530,9 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix) OPT_END() }; + if (argc == 2 && !strcmp(argv[1], "-h")) + usage_with_options(ls_files_usage, builtin_ls_files_options); + memset(&dir, 0, sizeof(dir)); prefix = cmd_prefix; if (prefix) diff --git a/builtin/merge.c b/builtin/merge.c index 3921cd3040..42fff387e6 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -922,6 +922,9 @@ int cmd_merge(int argc, const char **argv, const char *prefix) const char *best_strategy = NULL, *wt_strategy = NULL; struct commit_list **remotes = &remoteheads; + if (argc == 2 && !strcmp(argv[1], "-h")) + usage_with_options(builtin_merge_usage, builtin_merge_options); + /* * Check if we are _not_ on a detached HEAD, i.e. if there is a * current branch. diff --git a/builtin/update-index.c b/builtin/update-index.c index 62d9f3f0fa..200c7efed1 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -589,6 +589,9 @@ int cmd_update_index(int argc, const char **argv, const char *prefix) int lock_error = 0; struct lock_file *lock_file; + if (argc == 2 && !strcmp(argv[1], "-h")) + usage(update_index_usage); + git_config(git_default_config, NULL); /* We can't free this memory, it becomes part of a linked list parsed atexit() */ |