Source
xxxxxxxxxx
62
62
no_argument (or 0) if the option does not take an argument,
63
63
required_argument (or 1) if the option requires an argument,
64
64
optional_argument (or 2) if the option takes an optional argument.
65
65
66
66
If the field `flag' is not NULL, it points to a variable that is set
67
67
to the value given in the field `val' when the option is found, but
68
68
left unchanged if the option is not found.
69
69
70
70
To have a long-named option do something other than set an `int' to
71
71
a compiled-in constant, such as set a value from `optarg', set the
72
-
option's `flag' field to zero and its `val' field to a nonzero
72
+
option's `flag' field to zero and its `val' field to a non-zero
73
73
value (the equivalent single-letter option character, if there is
74
74
one). For long options that have a zero `flag' field, `getopt'
75
75
returns the contents of the `val' field. */
76
76
77
77
struct zbx_option
78
78
{
79
79
const char *name;
80
80
/* has_arg can't be an enum because some compilers complain about
81
81
type mismatches in all the code that assumes it is an int. */
82
82
int has_arg;