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 09:12:29 +0200 |
commit | 3e4a67b47d020c8c61d8a762d1903f5288e94778 (patch) | |
tree | 7ea0d479d94f8e8ef89b62230cd0d9606dc8a0c6 /builtin/am.c | |
parent | The sixth batch for 2.18 (diff) | |
download | git-3e4a67b47d020c8c61d8a762d1903f5288e94778.tar.xz git-3e4a67b47d020c8c61d8a762d1903f5288e94778.zip |
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/am.c')
-rw-r--r-- | builtin/am.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin/am.c b/builtin/am.c index d834f9e62b..a1ff235fbc 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -2231,12 +2231,12 @@ int cmd_am(int argc, const char **argv, const char *prefix) N_("pass -b flag to git-mailinfo"), KEEP_NON_PATCH), OPT_BOOL('m', "message-id", &state.message_id, N_("pass -m flag to git-mailinfo")), - { OPTION_SET_INT, 0, "keep-cr", &keep_cr, NULL, - N_("pass --keep-cr flag to git-mailsplit for mbox format"), - PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, 1}, - { OPTION_SET_INT, 0, "no-keep-cr", &keep_cr, NULL, - N_("do not pass --keep-cr flag to git-mailsplit independent of am.keepcr"), - PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, 0}, + OPT_SET_INT_F(0, "keep-cr", &keep_cr, + N_("pass --keep-cr flag to git-mailsplit for mbox format"), + 1, PARSE_OPT_NONEG), + OPT_SET_INT_F(0, "no-keep-cr", &keep_cr, + N_("do not pass --keep-cr flag to git-mailsplit independent of am.keepcr"), + 0, PARSE_OPT_NONEG), OPT_BOOL('c', "scissors", &state.scissors, N_("strip everything before a scissors line")), OPT_PASSTHRU_ARGV(0, "whitespace", &state.git_apply_opts, N_("action"), |