summaryrefslogtreecommitdiff
path: root/builtin/am.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-05-20 15:42:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-24 07:12:29 (GMT)
commit3e4a67b47d020c8c61d8a762d1903f5288e94778 (patch)
tree7ea0d479d94f8e8ef89b62230cd0d9606dc8a0c6 /builtin/am.c
parente144d126d74f5d2702870ca9423743102eec6fcd (diff)
downloadgit-3e4a67b47d020c8c61d8a762d1903f5288e94778.zip
git-3e4a67b47d020c8c61d8a762d1903f5288e94778.tar.gz
git-3e4a67b47d020c8c61d8a762d1903f5288e94778.tar.bz2
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.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin/am.c b/builtin/am.c
index d834f9e..a1ff235 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"),