aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorvodz <vodz@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-02-02 14:48:54 +0000
committervodz <vodz@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-02-02 14:48:54 +0000
commit86513ecc5ea94b4e90ca4659722712044d074aa8 (patch)
tree7f4e7befe49ad4dd9c488649cb04bc8aa10cd2fa /libbb
parentfe03e7d91035e34645b610d77b4b5c1c3ae3ca73 (diff)
downloadbusybox-w32-86513ecc5ea94b4e90ca4659722712044d074aa8.tar.gz
busybox-w32-86513ecc5ea94b4e90ca4659722712044d074aa8.tar.bz2
busybox-w32-86513ecc5ea94b4e90ca4659722712044d074aa8.zip
destroy bug 679, use getopt_ulflags with new feature: usage option. Removed two strdup
git-svn-id: svn://busybox.net/trunk/busybox@13797 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r--libbb/getopt_ulflags.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libbb/getopt_ulflags.c b/libbb/getopt_ulflags.c
index f18ee2d2d..3e77bbfea 100644
--- a/libbb/getopt_ulflags.c
+++ b/libbb/getopt_ulflags.c
@@ -182,6 +182,10 @@ Special characters:
182 "-N" A dash as the first char in a bb_opt_complementally group with 182 "-N" A dash as the first char in a bb_opt_complementally group with
183 number 0-9 as one char is means check minimal arguments required. 183 number 0-9 as one char is means check minimal arguments required.
184 184
185 "V-" A option with dash before colon or end line indicate: call
186 bb_show_usage if this option give, for example verbose
187 usage option.
188
185 "--" A double dash between two options, or between an option and a group 189 "--" A double dash between two options, or between an option and a group
186 of options, means that they are mutually exclusive. Unlike 190 of options, means that they are mutually exclusive. Unlike
187 the "-" case above, an error will be forced if the options 191 the "-" case above, an error will be forced if the options
@@ -387,6 +391,12 @@ bb_getopt_ulflags (int argc, char **argv, const char *applet_opts, ...)
387 requires |= on_off->switch_on; 391 requires |= on_off->switch_on;
388 continue; 392 continue;
389 } 393 }
394 if(c == '-' && (s[2] == ':' || s[2] == '\0')) {
395 flags |= on_off->switch_on;
396 on_off->incongruously |= on_off->switch_on;
397 s++;
398 continue;
399 }
390 if(c == *s) { 400 if(c == *s) {
391 on_off->counter = va_arg (p, int *); 401 on_off->counter = va_arg (p, int *);
392 s++; 402 s++;