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/difftool.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/difftool.c')
-rw-r--r-- | builtin/difftool.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/builtin/difftool.c b/builtin/difftool.c index aad0e073ee..c439b64207 100644 --- a/builtin/difftool.c +++ b/builtin/difftool.c @@ -695,12 +695,11 @@ int cmd_difftool(int argc, const char **argv, const char *prefix) N_("use `diff.guitool` instead of `diff.tool`")), OPT_BOOL('d', "dir-diff", &dir_diff, N_("perform a full-directory diff")), - { OPTION_SET_INT, 'y', "no-prompt", &prompt, NULL, + OPT_SET_INT_F('y', "no-prompt", &prompt, N_("do not prompt before launching a diff tool"), - PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, 0}, - { OPTION_SET_INT, 0, "prompt", &prompt, NULL, NULL, - PARSE_OPT_NOARG | PARSE_OPT_NONEG | PARSE_OPT_HIDDEN, - NULL, 1 }, + 0, PARSE_OPT_NONEG), + OPT_SET_INT_F(0, "prompt", &prompt, NULL, + 1, PARSE_OPT_NONEG | PARSE_OPT_HIDDEN), OPT_BOOL(0, "symlinks", &symlinks, N_("use symlinks in dir-diff mode")), OPT_STRING('t', "tool", &difftool_cmd, N_("<tool>"), |