diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2018-05-20 17:42:58 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-24 16:12:29 +0900 |
commit | 3e4a67b47d020c8c61d8a762d1903f5288e94778 (patch) | |
tree | 7ea0d479d94f8e8ef89b62230cd0d9606dc8a0c6 /builtin/grep.c | |
parent | The sixth batch for 2.18 (diff) | |
download | tgif-3e4a67b47d020c8c61d8a762d1903f5288e94778.tar.xz |
Use OPT_SET_INT_F() for cmdline option specification
The only thing these commands need is extra parseopt flag which can be
passed in by OPT_SET_INT_F() and it is a bit more compact than full
struct initialization.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/grep.c')
-rw-r--r-- | builtin/grep.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/grep.c b/builtin/grep.c index 6e7bc76785..850bcffd99 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -885,9 +885,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix) N_("indicate hit with exit status without output")), OPT_BOOL(0, "all-match", &opt.all_match, N_("show only matches from files that match all patterns")), - { OPTION_SET_INT, 0, "debug", &opt.debug, NULL, - N_("show parse tree for grep expression"), - PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 1 }, + OPT_SET_INT_F(0, "debug", &opt.debug, + N_("show parse tree for grep expression"), + 1, PARSE_OPT_HIDDEN), OPT_GROUP(""), { OPTION_STRING, 'O', "open-files-in-pager", &show_in_pager, N_("pager"), N_("show matching files in the pager"), |