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>
This commit is contained in:
Nguyễn Thái Ngọc Duy
2018-05-20 17:42:58 +02:00
committed by Junio C Hamano
parent e144d126d7
commit 3e4a67b47d
11 changed files with 47 additions and 50 deletions

View File

@ -778,13 +778,13 @@ static int merge(int argc, const char **argv, const char *prefix)
N_("resolve notes conflicts using the given strategy "
"(manual/ours/theirs/union/cat_sort_uniq)")),
OPT_GROUP(N_("Committing unmerged notes")),
{ OPTION_SET_INT, 0, "commit", &do_commit, NULL,
N_("finalize notes merge by committing unmerged notes"),
PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, 1},
OPT_SET_INT_F(0, "commit", &do_commit,
N_("finalize notes merge by committing unmerged notes"),
1, PARSE_OPT_NONEG),
OPT_GROUP(N_("Aborting notes merge resolution")),
{ OPTION_SET_INT, 0, "abort", &do_abort, NULL,
N_("abort notes merge"),
PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, 1},
OPT_SET_INT_F(0, "abort", &do_abort,
N_("abort notes merge"),
1, PARSE_OPT_NONEG),
OPT_END()
};