From: Junio C Hamano Date: Wed, 12 Aug 2015 21:09:57 +0000 (-0700) Subject: Merge branch 'sb/parse-options-codeformat' X-Git-Tag: v2.6.0-rc0~73 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/535efaf6beb039b9f3b6f6c0f2b526eb8d02f99b?hp=-c Merge branch 'sb/parse-options-codeformat' * sb/parse-options-codeformat: parse-options: align curly braces for all options --- 535efaf6beb039b9f3b6f6c0f2b526eb8d02f99b diff --combined parse-options.h index 6ca8388a53,08d7818935..3f1cc3aee0 --- a/parse-options.h +++ b/parse-options.h @@@ -16,7 -16,6 +16,7 @@@ enum parse_opt_type /* options with arguments (usually) */ OPTION_STRING, OPTION_INTEGER, + OPTION_MAGNITUDE, OPTION_CALLBACK, OPTION_LOWLEVEL_CALLBACK, OPTION_FILENAME @@@ -127,11 -126,9 +127,11 @@@ struct option #define OPT_BOOL(s, l, v, h) OPT_SET_INT(s, l, v, h, 1) #define OPT_HIDDEN_BOOL(s, l, v, h) { OPTION_SET_INT, (s), (l), (v), NULL, \ (h), PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 1} - #define OPT_CMDMODE(s, l, v, h, i) { OPTION_CMDMODE, (s), (l), (v), NULL, \ + #define OPT_CMDMODE(s, l, v, h, i) { OPTION_CMDMODE, (s), (l), (v), NULL, \ (h), PARSE_OPT_NOARG|PARSE_OPT_NONEG, NULL, (i) } #define OPT_INTEGER(s, l, v, h) { OPTION_INTEGER, (s), (l), (v), N_("n"), (h) } +#define OPT_MAGNITUDE(s, l, v, h) { OPTION_MAGNITUDE, (s), (l), (v), \ + N_("n"), (h), PARSE_OPT_NONEG } #define OPT_STRING(s, l, v, a, h) { OPTION_STRING, (s), (l), (v), (a), (h) } #define OPT_STRING_LIST(s, l, v, a, h) \ { OPTION_CALLBACK, (s), (l), (v), (a), \ @@@ -227,8 -224,6 +227,8 @@@ extern int parse_opt_with_commit(const extern int parse_opt_tertiary(const struct option *, const char *, int); extern int parse_opt_string_list(const struct option *, const char *, int); extern int parse_opt_noop_cb(const struct option *, const char *, int); +extern int parse_opt_passthru(const struct option *, const char *, int); +extern int parse_opt_passthru_argv(const struct option *, const char *, int); #define OPT__VERBOSE(var, h) OPT_COUNTUP('v', "verbose", (var), (h)) #define OPT__QUIET(var, h) OPT_COUNTUP('q', "quiet", (var), (h)) @@@ -247,9 -242,5 +247,9 @@@ OPT_COLOR_FLAG(0, "color", (var), (h)) #define OPT_COLUMN(s, l, v, h) \ { OPTION_CALLBACK, (s), (l), (v), N_("style"), (h), PARSE_OPT_OPTARG, parseopt_column_callback } +#define OPT_PASSTHRU(s, l, v, a, h, f) \ + { OPTION_CALLBACK, (s), (l), (v), (a), (h), (f), parse_opt_passthru } +#define OPT_PASSTHRU_ARGV(s, l, v, a, h, f) \ + { OPTION_CALLBACK, (s), (l), (v), (a), (h), (f), parse_opt_passthru_argv } #endif