diff options
Diffstat (limited to 'parse-options.h')
-rw-r--r-- | parse-options.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/parse-options.h b/parse-options.h index 6db7cb31cc..ea4af92a51 100644 --- a/parse-options.h +++ b/parse-options.h @@ -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 @@ -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), \ @@ -196,7 +199,7 @@ enum { struct parse_opt_ctx_t { const char **argv; const char **out; - int argc, cpidx; + int argc, cpidx, total; const char *opt; int flags; const char *prefix; @@ -225,6 +228,8 @@ extern int parse_opt_commits(const struct option *, const char *, int); 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)) @@ -243,6 +248,10 @@ extern int parse_opt_noop_cb(const struct option *, const char *, int); 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 } #define _OPT_CONTAINS_OR_WITH(name, variable, help, flag) \ { OPTION_CALLBACK, 0, name, (variable), N_("commit"), (help), \ PARSE_OPT_LASTARG_DEFAULT | flag, \ |