getopt_ulflags: fix indentation in comment (needs to be 8 _spaces_
in order to look correct to both 4 tab and 8 tab population). Add comment about :: (which indicates optional argument).
This commit is contained in:
parent
b02ef82c99
commit
f0d6cc8ca9
1 changed files with 183 additions and 177 deletions
|
@ -60,6 +60,11 @@ bb_getopt_ulflags(int argc, char **argv, const char *applet_opts, ...)
|
||||||
by the "::" special separator that is set in the external string
|
by the "::" special separator that is set in the external string
|
||||||
bb_opt_complementally (see below for more info).
|
bb_opt_complementally (see below for more info).
|
||||||
|
|
||||||
|
"::" If option can have an *optional* argument, then add a "::"
|
||||||
|
after its char in applet_opts and provide a pointer to store
|
||||||
|
the argument. Note that optional arguments _must_
|
||||||
|
immediately follow the option: -oparam, not -o param.
|
||||||
|
|
||||||
"+" If the first character in the applet_opts string is a plus,
|
"+" If the first character in the applet_opts string is a plus,
|
||||||
then option processing will stop as soon as a non-option is
|
then option processing will stop as soon as a non-option is
|
||||||
encountered in the argv array. Useful for applets like env
|
encountered in the argv array. Useful for applets like env
|
||||||
|
@ -267,11 +272,12 @@ Special characters:
|
||||||
bb_opt_complementally = "K:S:?K--S:S--K";
|
bb_opt_complementally = "K:S:?K--S:S--K";
|
||||||
flags = bb_getopt_ulflags(argc, argv, "KS...);
|
flags = bb_getopt_ulflags(argc, argv, "KS...);
|
||||||
|
|
||||||
Don't forget to use ':'. For example "?322-22-23X-x-a" is interpreted as
|
|
||||||
"?3:22:-2:2-2:2-3Xa:2--x": max 3 args; count uses of '-2'; min 2 args;
|
|
||||||
if there is a '-2' option then unset '-3', '-X' and '-a'; if there is
|
|
||||||
a '-2' and after it a '-x' then error out.
|
|
||||||
|
|
||||||
|
Don't forget to use ':'. For example, "?322-22-23X-x-a"
|
||||||
|
is interpreted as "?3:22:-2:2-2:2-3Xa:2--x" -
|
||||||
|
max 3 args; count uses of '-2'; min 2 args; if there is
|
||||||
|
a '-2' option then unset '-3', '-X' and '-a'; if there is
|
||||||
|
a '-2' and after it a '-x' then error out.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* this should be bb_opt_complementary, but we'll just keep it as
|
/* this should be bb_opt_complementary, but we'll just keep it as
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue