@@ -22,6 +22,41 @@ enum parse_opt_option_flags {
2222struct option ;
2323typedef int parse_opt_cb (const struct option * , const char * arg , int unset );
2424
25+ /*
26+ * `type`::
27+ * holds the type of the option, you must have an OPTION_END last in your
28+ * array.
29+ *
30+ * `short_name`::
31+ * the character to use as a short option name, '\0' if none.
32+ *
33+ * `long_name`::
34+ * the long option name, without the leading dashes, NULL if none.
35+ *
36+ * `value`::
37+ * stores pointers to the values to be filled.
38+ *
39+ * `argh`::
40+ * token to explain the kind of argument this option wants. Keep it
41+ * homogenous across the repository.
42+ *
43+ * `help`::
44+ * the short help associated to what the option does.
45+ * Must never be NULL (except for OPTION_END).
46+ * OPTION_GROUP uses this pointer to store the group header.
47+ *
48+ * `flags`::
49+ * mask of parse_opt_option_flags.
50+ * PARSE_OPT_OPTARG: says that the argument is optionnal (not for BOOLEANs)
51+ * PARSE_OPT_NOARG: says that this option takes no argument, for CALLBACKs
52+ *
53+ * `callback`::
54+ * pointer to the callback to use for OPTION_CALLBACK.
55+ *
56+ * `defval`::
57+ * default value to fill (*->value) with for PARSE_OPT_OPTARG.
58+ * CALLBACKS can use it like they want.
59+ */
2560struct option {
2661 enum parse_opt_type type ;
2762 int short_name ;
@@ -32,8 +67,6 @@ struct option {
3267
3368 int flags ;
3469 parse_opt_cb * callback ;
35- /* holds default value for PARSE_OPT_OPTARG,
36- though callbacks can use it like they want */
3770 intptr_t defval ;
3871};
3972
0 commit comments