@@ -19,31 +19,37 @@ typedef enum {
19
19
ADOPT_TYPE_NONE = 0 ,
20
20
21
21
/**
22
- * An argument that, when specified, sets a given value to true.
23
- * This is useful for arguments like "--debug". A converse
24
- * argument (beginning with "no-") is implicitly specified; for
22
+ * An option that, when specified, sets a given value to true.
23
+ * This is useful for options like "--debug". A negation
24
+ * option (beginning with "no-") is implicitly specified; for
25
25
* example "--no-debug". The `value` pointer in the returned
26
26
* option will be set to `1` when this is specified, and set to
27
- * `0` when the converse "no-" argument is specified.
27
+ * `0` when the negation "no-" option is specified.
28
28
*/
29
29
ADOPT_TYPE_BOOL ,
30
30
31
31
/**
32
- * An argument that, when specified, sets the given `value_ptr`
32
+ * An option that, when specified, sets the given `value_ptr`
33
33
* to the given `value`.
34
34
*/
35
35
ADOPT_TYPE_SWITCH ,
36
36
37
- /** An argument that has a value ("-nvalue" or "--name value") */
37
+ /** An option that has a value ("-nvalue" or "--name value") */
38
38
ADOPT_TYPE_VALUE ,
39
39
40
- /** The literal arguments follow specifier, bare "--" */
40
+ /**
41
+ * A bare "--" that indicates that arguments following this are
42
+ * literal. This allows callers to specify things that might
43
+ * otherwise look like options, for example to operate on a file
44
+ * named "-rf" then you can invoke "program -- -rf" to treat
45
+ * "-rf" as an argument not an option.
46
+ */
41
47
ADOPT_TYPE_LITERAL ,
42
48
43
- /** A single "free" argument ("path") */
49
+ /** A single bare argument ("path") */
44
50
ADOPT_TYPE_ARG ,
45
51
46
- /** Unmatched arguments, a collection of "free" arguments ("paths...") */
52
+ /** Unmatched arguments, a collection of bare arguments ("paths...") */
47
53
ADOPT_TYPE_ARGS ,
48
54
} adopt_type_t ;
49
55
0 commit comments