summaryrefslogtreecommitdiff
path: root/parse-options.h
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-08-03 11:01:13 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-08-03 11:01:13 -0700
commite12b51e4d685c30f488c99c5d89f3310c3fcd9b0 (patch)
tree57edea5f304464e3865ffecc6fb475b41f2fa0e8 /parse-options.h
parentMerge branch 'bc/gpg-verify-raw' (diff)
parentparse-options: move unsigned long option parsing out of pack-objects.c (diff)
downloadtgif-e12b51e4d685c30f488c99c5d89f3310c3fcd9b0.tar.xz
Merge branch 'cb/parse-magnitude'
Move machinery to parse human-readable scaled numbers like 1k, 4M, and 2G as an option parameter's value from pack-objects to parse-options API, to make it available to other codepaths. * cb/parse-magnitude: parse-options: move unsigned long option parsing out of pack-objects.c test-parse-options: update to handle negative ints
Diffstat (limited to 'parse-options.h')
-rw-r--r--parse-options.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/parse-options.h b/parse-options.h
index c71e9da4f8..ca865f66d7 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
@@ -129,6 +130,8 @@ struct option {
#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), \