summaryrefslogtreecommitdiff
path: root/builtin/rev-list.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-06-01 14:09:14 +0900
committerJunio C Hamano <gitster@pobox.com>2017-06-01 14:56:18 +0900
commit60f32610243165e43afca785a85c38967130a70f (patch)
treeb32cebc3328c5e63aef5f573bd82569fb3c48caa /builtin/rev-list.c
parent29ec62700ad3db6be572c6f3c03a7d0443c86353 (diff)
downloadgit-jc/wip-check-help-option.tar.gz
check_help_option(): a helper for early check of "-h" optionjc/wip-check-help-option
As "show help when we get '-h' as the only option." often appears, let's give an easy helper to call for these call sites. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rev-list.c')
-rw-r--r--builtin/rev-list.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index b250c515b1..ce6acf18c7 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -277,8 +277,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
int use_bitmap_index = 0;
const char *show_progress = NULL;
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage(rev_list_usage);
+ check_help_option(argc, argv, rev_list_usage, NULL);
git_config(git_default_config, NULL);
init_revisions(&revs, prefix);