aboutsummaryrefslogtreecommitdiffstats
path: root/parse-options.h
diff options
context:
space:
mode:
Diffstat (limited to 'parse-options.h')
-rw-r--r--parse-options.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/parse-options.h b/parse-options.h
index 14e4df1ee2..4c430c7273 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -92,6 +92,10 @@ typedef int parse_opt_subcommand_fn(int argc, const char **argv,
* `value`::
* stores pointers to the values to be filled.
*
+ * `precision`::
+ * precision of the integer pointed to by `value` in number of bytes. Should
+ * typically be its `sizeof()`.
+ *
* `argh`::
* token to explain the kind of argument this option wants. Does not
* begin in capital letter, and does not end with a full stop.
@@ -151,6 +155,7 @@ struct option {
int short_name;
const char *long_name;
void *value;
+ size_t precision;
const char *argh;
const char *help;
@@ -214,6 +219,7 @@ struct option {
.short_name = (s), \
.long_name = (l), \
.value = (v), \
+ .precision = sizeof(*v), \
.argh = N_("n"), \
.help = (h), \
.flags = (f), \