@@ -67,7 +67,7 @@ typedef int parse_opt_cb(const struct option *, const char *arg, int unset);
6767 * `flags`::
6868 * mask of parse_opt_option_flags.
6969 * PARSE_OPT_OPTARG: says that the argument is optional (not for BOOLEANs)
70- * PARSE_OPT_NOARG: says that this option takes no argument, for CALLBACKs
70+ * PARSE_OPT_NOARG: says that this option takes no argument
7171 * PARSE_OPT_NONEG: says that this option cannot be negated
7272 * PARSE_OPT_HIDDEN: this option is skipped in the default usage, and
7373 * shown only in the full usage.
@@ -104,14 +104,20 @@ struct option {
104104};
105105
106106#define OPT_END () { OPTION_END }
107- #define OPT_ARGUMENT (l , h ) { OPTION_ARGUMENT, 0, (l), NULL, NULL, (h) }
107+ #define OPT_ARGUMENT (l , h ) { OPTION_ARGUMENT, 0, (l), NULL, NULL, \
108+ (h), PARSE_OPT_NOARG}
108109#define OPT_GROUP (h ) { OPTION_GROUP, 0, NULL, NULL, NULL, (h) }
109- #define OPT_BIT (s , l , v , h , b ) { OPTION_BIT, (s), (l), (v), NULL, (h), 0, NULL, (b) }
110- #define OPT_NEGBIT (s , l , v , h , b ) { OPTION_NEGBIT, (s), (l), (v), NULL, (h), 0, NULL, (b) }
111- #define OPT_BOOLEAN (s , l , v , h ) { OPTION_BOOLEAN, (s), (l), (v), NULL, (h) }
112- #define OPT_SET_INT (s , l , v , h , i ) { OPTION_SET_INT, (s), (l), (v), NULL, (h), 0, NULL, (i) }
113- #define OPT_SET_PTR (s , l , v , h , p ) { OPTION_SET_PTR, (s), (l), (v), NULL, (h), 0, NULL, (p) }
114- #define OPT_INTEGER (s , l , v , h ) { OPTION_INTEGER, (s), (l), (v), NULL, (h) }
110+ #define OPT_BIT (s , l , v , h , b ) { OPTION_BIT, (s), (l), (v), NULL, (h), \
111+ PARSE_OPT_NOARG, NULL, (b) }
112+ #define OPT_NEGBIT (s , l , v , h , b ) { OPTION_NEGBIT, (s), (l), (v), NULL, \
113+ (h), PARSE_OPT_NOARG, NULL, (b) }
114+ #define OPT_BOOLEAN (s , l , v , h ) { OPTION_BOOLEAN, (s), (l), (v), NULL, \
115+ (h), PARSE_OPT_NOARG }
116+ #define OPT_SET_INT (s , l , v , h , i ) { OPTION_SET_INT, (s), (l), (v), NULL, \
117+ (h), PARSE_OPT_NOARG, NULL, (i) }
118+ #define OPT_SET_PTR (s , l , v , h , p ) { OPTION_SET_PTR, (s), (l), (v), NULL, \
119+ (h), PARSE_OPT_NOARG, NULL, (p) }
120+ #define OPT_INTEGER (s , l , v , h ) { OPTION_INTEGER, (s), (l), (v), "n", (h) }
115121#define OPT_STRING (s , l , v , a , h ) { OPTION_STRING, (s), (l), (v), (a), (h) }
116122#define OPT_DATE (s , l , v , h ) \
117123 { OPTION_CALLBACK, (s), (l), (v), "time",(h), 0, \
0 commit comments