diff options
author | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2006-02-02 14:48:54 +0000 |
---|---|---|
committer | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2006-02-02 14:48:54 +0000 |
commit | 4fc92206ed4ade658fa1d606c93ee1aee771179b (patch) | |
tree | 7f4e7befe49ad4dd9c488649cb04bc8aa10cd2fa /libbb/getopt_ulflags.c | |
parent | b38673fb9fee63303cc6b7d4923ea0dd7cf7310a (diff) |
destroy bug 679, use getopt_ulflags with new feature: usage option. Removed two strdup
Diffstat (limited to 'libbb/getopt_ulflags.c')
-rw-r--r-- | libbb/getopt_ulflags.c | 10 |
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: "-N" A dash as the first char in a bb_opt_complementally group with number 0-9 as one char is means check minimal arguments required. + "V-" A option with dash before colon or end line indicate: call + bb_show_usage if this option give, for example verbose + usage option. + "--" A double dash between two options, or between an option and a group of options, means that they are mutually exclusive. Unlike 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, ...) requires |= on_off->switch_on; continue; } + if(c == '-' && (s[2] == ':' || s[2] == '\0')) { + flags |= on_off->switch_on; + on_off->incongruously |= on_off->switch_on; + s++; + continue; + } if(c == *s) { on_off->counter = va_arg (p, int *); s++; |