diff options
author | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2005-10-05 13:58:40 +0000 |
---|---|---|
committer | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2005-10-05 13:58:40 +0000 |
commit | 4a5ce08688bc22d5b66363bfad4628b0b57d60f4 (patch) | |
tree | 1d4921567b40c0b3c6d0589da9c7773835434ec2 | |
parent | b48bfe795ec20dc03ead851ea7c56b053f1289af (diff) | |
download | busybox-w32-4a5ce08688bc22d5b66363bfad4628b0b57d60f4.tar.gz busybox-w32-4a5ce08688bc22d5b66363bfad4628b0b57d60f4.tar.bz2 busybox-w32-4a5ce08688bc22d5b66363bfad4628b0b57d60f4.zip |
another more correction for getopt_ulflags() documentation (examples)
-rw-r--r-- | libbb/getopt_ulflags.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libbb/getopt_ulflags.c b/libbb/getopt_ulflags.c index 5ed9c2e70..2e2ee0b6b 100644 --- a/libbb/getopt_ulflags.c +++ b/libbb/getopt_ulflags.c | |||
@@ -134,9 +134,12 @@ const char *bb_opt_complementally | |||
134 | llist_t *my_b = NULL; | 134 | llist_t *my_b = NULL; |
135 | int verbose_level = 0; | 135 | int verbose_level = 0; |
136 | bb_opt_complementally = "vv:b*:b-c:c-b"; | 136 | bb_opt_complementally = "vv:b*:b-c:c-b"; |
137 | bb_getopt_ulflags(argc, argv, "vb:c", &my_b, &verbose_level); | 137 | f = bb_getopt_ulflags(argc, argv, "vb:c", &my_b, &verbose_level); |
138 | while (my_b) { dosomething_with(my_b->data) ; my_b = my_b->link; } | 138 | if((f & 2)) // -c after -b unset this -b flag |
139 | if (verbose_level) bb_printf("verbose\n"); | 139 | while (my_b) { dosomething_with(my_b->data) ; my_b = my_b->link; } |
140 | if(my_b) // but llist stored always if -b found | ||
141 | free_llist(my_b); | ||
142 | if (verbose_level) bb_printf("verbose level is %d\n", verbose_level); | ||
140 | 143 | ||
141 | Special characters: | 144 | Special characters: |
142 | 145 | ||
@@ -174,8 +177,8 @@ Special characters: | |||
174 | bb_opt_complementally = "-:w-x:x-w"; | 177 | bb_opt_complementally = "-:w-x:x-w"; |
175 | bb_getopt_ulflags(argc, argv, "wx"); | 178 | bb_getopt_ulflags(argc, argv, "wx"); |
176 | 179 | ||
177 | Allows option 'w' to be given without a dash (./program w x) | 180 | Allows any arguments to be given without a dash (./program w x) |
178 | as well as with a dash (./program -x). | 181 | as well as with a dash (./program -x). Why unset -w see above. |
179 | 182 | ||
180 | "~" A tilde between two options, or between an option and a group | 183 | "~" A tilde between two options, or between an option and a group |
181 | of options, means that they are mutually exclusive. Unlike | 184 | of options, means that they are mutually exclusive. Unlike |