now that mjn3 explained it to me, add documentation for the 3rd field in long opts
This commit is contained in:
parent
00e76cb6b9
commit
fb6d22c96c
@ -80,13 +80,20 @@ static const struct option bb_default_long_options[]
|
|||||||
};
|
};
|
||||||
bb_applet_long_options = applet_long_options;
|
bb_applet_long_options = applet_long_options;
|
||||||
|
|
||||||
The first parameter is the long option that you would pass to
|
The first parameter is the long option name that you would pass
|
||||||
the applet (--verbose) in place of the short option (-v). The
|
to the applet (without the dashes).
|
||||||
second field determines whether the option has an argument.
|
|
||||||
|
The second field determines whether the option has an argument.
|
||||||
You can set this to 0, 1, or 2, or you can use the long named
|
You can set this to 0, 1, or 2, or you can use the long named
|
||||||
defines of no_argument, required_argument, and optional_argument.
|
defines of no_argument, required_argument, and optional_argument.
|
||||||
Just set the third argument to '0' or 'NULL'. The last argument
|
|
||||||
is simply the short option without the dash of course.
|
The third argument is used only when the long option does not
|
||||||
|
have a corresponding short option. In that case, it should be
|
||||||
|
an integer pointer. Otherwise (and normally), it should just
|
||||||
|
bet set to NULL.
|
||||||
|
|
||||||
|
The last argument is the corresponding short option (if there
|
||||||
|
is one of course).
|
||||||
|
|
||||||
Note: a good applet will make long options configurable via the
|
Note: a good applet will make long options configurable via the
|
||||||
config process and not a required feature. The current standard
|
config process and not a required feature. The current standard
|
||||||
|
Loading…
Reference in New Issue
Block a user