]> git.ipfire.org Git - thirdparty/git.git/blobdiff - parse-options.h
parseopt: add OPT_NUMBER_CALLBACK
[thirdparty/git.git] / parse-options.h
index f1e2452f69756d9d3c4fc444d37dbdd224194809..77919a77fb155f13a791dcd21e95bb6a30199138 100644 (file)
@@ -6,6 +6,7 @@ enum parse_opt_type {
        OPTION_END,
        OPTION_ARGUMENT,
        OPTION_GROUP,
+       OPTION_NUMBER,
        /* options with no arguments */
        OPTION_BIT,
        OPTION_NEGBIT,
@@ -105,6 +106,9 @@ struct option {
          parse_opt_approxidate_cb }
 #define OPT_CALLBACK(s, l, v, a, h, f) \
        { OPTION_CALLBACK, (s), (l), (v), (a), (h), 0, (f) }
+#define OPT_NUMBER_CALLBACK(v, h, f) \
+       { OPTION_NUMBER, 0, NULL, (v), NULL, (h), \
+         PARSE_OPT_NOARG | PARSE_OPT_NONEG, (f) }
 
 /* parse_options() will filter out the processed options and leave the
  * non-option arguments in argv[].