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:
committed by
Junio C Hamano
parent
e144d126d7
commit
3e4a67b47d
@ -411,11 +411,9 @@ static void parse_treeish_arg(const char **argv,
|
||||
}
|
||||
|
||||
#define OPT__COMPR(s, v, h, p) \
|
||||
{ OPTION_SET_INT, (s), NULL, (v), NULL, (h), \
|
||||
PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, (p) }
|
||||
OPT_SET_INT_F(s, NULL, v, h, p, PARSE_OPT_NONEG)
|
||||
#define OPT__COMPR_HIDDEN(s, v, p) \
|
||||
{ OPTION_SET_INT, (s), NULL, (v), NULL, "", \
|
||||
PARSE_OPT_NOARG | PARSE_OPT_NONEG | PARSE_OPT_HIDDEN, NULL, (p) }
|
||||
OPT_SET_INT_F(s, NULL, v, "", p, PARSE_OPT_NONEG | PARSE_OPT_HIDDEN)
|
||||
|
||||
static int parse_archive_args(int argc, const char **argv,
|
||||
const struct archiver **ar, struct archiver_args *args,
|
||||
|
||||
Reference in New Issue
Block a user