.. | .. |
---|
25 | 25 | OPTION_STRING, |
---|
26 | 26 | OPTION_INTEGER, |
---|
27 | 27 | OPTION_LONG, |
---|
| 28 | + OPTION_ULONG, |
---|
28 | 29 | OPTION_CALLBACK, |
---|
29 | 30 | OPTION_U64, |
---|
30 | 31 | OPTION_UINTEGER, |
---|
.. | .. |
---|
70 | 71 | * |
---|
71 | 72 | * `argh`:: |
---|
72 | 73 | * token to explain the kind of argument this option wants. Keep it |
---|
73 | | - * homogenous across the repository. |
---|
| 74 | + * homogeneous across the repository. |
---|
74 | 75 | * |
---|
75 | 76 | * `help`:: |
---|
76 | 77 | * the short help associated to what the option does. |
---|
.. | .. |
---|
79 | 80 | * |
---|
80 | 81 | * `flags`:: |
---|
81 | 82 | * mask of parse_opt_option_flags. |
---|
82 | | - * PARSE_OPT_OPTARG: says that the argument is optionnal (not for BOOLEANs) |
---|
| 83 | + * PARSE_OPT_OPTARG: says that the argument is optional (not for BOOLEANs) |
---|
83 | 84 | * PARSE_OPT_NOARG: says that this option takes no argument, for CALLBACKs |
---|
84 | 85 | * PARSE_OPT_NONEG: says that this option cannot be negated |
---|
85 | 86 | * PARSE_OPT_HIDDEN this option is skipped in the default usage, showed in |
---|
.. | .. |
---|
133 | 134 | #define OPT_INTEGER(s, l, v, h) { .type = OPTION_INTEGER, .short_name = (s), .long_name = (l), .value = check_vtype(v, int *), .help = (h) } |
---|
134 | 135 | #define OPT_UINTEGER(s, l, v, h) { .type = OPTION_UINTEGER, .short_name = (s), .long_name = (l), .value = check_vtype(v, unsigned int *), .help = (h) } |
---|
135 | 136 | #define OPT_LONG(s, l, v, h) { .type = OPTION_LONG, .short_name = (s), .long_name = (l), .value = check_vtype(v, long *), .help = (h) } |
---|
| 137 | +#define OPT_ULONG(s, l, v, h) { .type = OPTION_ULONG, .short_name = (s), .long_name = (l), .value = check_vtype(v, unsigned long *), .help = (h) } |
---|
136 | 138 | #define OPT_U64(s, l, v, h) { .type = OPTION_U64, .short_name = (s), .long_name = (l), .value = check_vtype(v, u64 *), .help = (h) } |
---|
137 | 139 | #define OPT_STRING(s, l, v, a, h) { .type = OPTION_STRING, .short_name = (s), .long_name = (l), .value = check_vtype(v, const char **), .argh = (a), .help = (h) } |
---|
138 | 140 | #define OPT_STRING_OPTARG(s, l, v, a, h, d) \ |
---|
.. | .. |
---|
149 | 151 | { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = "time", .help = (h), .callback = parse_opt_approxidate_cb } |
---|
150 | 152 | #define OPT_CALLBACK(s, l, v, a, h, f) \ |
---|
151 | 153 | { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = (a), .help = (h), .callback = (f) } |
---|
| 154 | +#define OPT_CALLBACK_SET(s, l, v, os, a, h, f) \ |
---|
| 155 | + { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = (a), .help = (h), .callback = (f), .set = check_vtype(os, bool *)} |
---|
152 | 156 | #define OPT_CALLBACK_NOOPT(s, l, v, a, h, f) \ |
---|
153 | 157 | { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = (a), .help = (h), .callback = (f), .flags = PARSE_OPT_NOARG } |
---|
154 | 158 | #define OPT_CALLBACK_DEFAULT(s, l, v, a, h, f, d) \ |
---|