@@ -22,6 +22,41 @@ enum parse_opt_option_flags {
22
22
struct option ;
23
23
typedef int parse_opt_cb (const struct option * , const char * arg , int unset );
24
24
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
+ */
25
60
struct option {
26
61
enum parse_opt_type type ;
27
62
int short_name ;
@@ -32,8 +67,6 @@ struct option {
32
67
33
68
int flags ;
34
69
parse_opt_cb * callback ;
35
- /* holds default value for PARSE_OPT_OPTARG,
36
- though callbacks can use it like they want */
37
70
intptr_t defval ;
38
71
};
39
72
0 commit comments