X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=parse-options.h;h=59e0b524bdcbe1c061f49b8e5f3c6365a9f2eba4;hb=5e2b3d7c6741fdd65e195fbe3af98b6d8d2fa551;hp=d1b12fe979b34ac9bbf2ff637934b96f3878a53d;hpb=5480861c24b6f5830c2301ae2f50e21ef3cdeaf2;p=git.git diff --git a/parse-options.h b/parse-options.h index d1b12fe97..59e0b524b 100644 --- a/parse-options.h +++ b/parse-options.h @@ -130,6 +130,9 @@ struct option { (h), PARSE_OPT_NOARG, NULL, (p) } #define OPT_INTEGER(s, l, v, h) { OPTION_INTEGER, (s), (l), (v), "n", (h) } #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), \ + (h), 0, &parse_opt_string_list } #define OPT_UYN(s, l, v, h) { OPTION_CALLBACK, (s), (l), (v), NULL, \ (h), PARSE_OPT_NOARG, &parse_opt_tertiary } #define OPT_DATE(s, l, v, h) \ @@ -162,6 +165,8 @@ extern NORETURN void usage_msg_opt(const char *msg, const char * const *usagestr, const struct option *options); +extern int optbug(const struct option *opt, const char *reason); +extern int opterror(const struct option *opt, const char *reason, int flags); /*----- incremental advanced APIs -----*/ enum { @@ -204,6 +209,7 @@ extern int parse_opt_color_flag_cb(const struct option *, const char *, int); extern int parse_opt_verbosity_cb(const struct option *, const char *, int); extern int parse_opt_with_commit(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); #define OPT__VERBOSE(var, h) OPT_BOOLEAN('v', "verbose", (var), (h)) #define OPT__QUIET(var, h) OPT_BOOLEAN('q', "quiet", (var), (h))