Skip to content

Commit 47e5022

Browse files
committed
improved documentation
1 parent 05edb37 commit 47e5022

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

adopt.h

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,37 @@ typedef enum {
1919
ADOPT_TYPE_NONE = 0,
2020

2121
/**
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
2525
* example "--no-debug". The `value` pointer in the returned
2626
* 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.
2828
*/
2929
ADOPT_TYPE_BOOL,
3030

3131
/**
32-
* An argument that, when specified, sets the given `value_ptr`
32+
* An option that, when specified, sets the given `value_ptr`
3333
* to the given `value`.
3434
*/
3535
ADOPT_TYPE_SWITCH,
3636

37-
/** An argument that has a value ("-nvalue" or "--name value") */
37+
/** An option that has a value ("-nvalue" or "--name value") */
3838
ADOPT_TYPE_VALUE,
3939

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+
*/
4147
ADOPT_TYPE_LITERAL,
4248

43-
/** A single "free" argument ("path") */
49+
/** A single bare argument ("path") */
4450
ADOPT_TYPE_ARG,
4551

46-
/** Unmatched arguments, a collection of "free" arguments ("paths...") */
52+
/** Unmatched arguments, a collection of bare arguments ("paths...") */
4753
ADOPT_TYPE_ARGS,
4854
} adopt_type_t;
4955

0 commit comments

Comments
 (0)