aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-09-03 12:27:25 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-09-03 12:27:25 +0000
commit65dbd8752b4b183c11a631792ef2ad07a7f251e4 (patch)
treec329baa5221e9a09844482c842dc78af7468e312 /libbb
parent60e3dd60160e0a3192fd0f2ed02cf6407ef36ed4 (diff)
downloadbusybox-65dbd8752b4b183c11a631792ef2ad07a7f251e4.tar.gz
zcip: getopt -> bb_getopt_ulflags
Diffstat (limited to 'libbb')
-rw-r--r--libbb/getopt_ulflags.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libbb/getopt_ulflags.c b/libbb/getopt_ulflags.c
index 19c96914d..e0dc1371f 100644
--- a/libbb/getopt_ulflags.c
+++ b/libbb/getopt_ulflags.c
@@ -36,6 +36,13 @@ bb_getopt_ulflags (int argc, char **argv, const char *applet_opts, ...)
and so on. You can also look at the return value as a bit
field and each option sets one bit.
+ On exit, global variable optind is set so that if you
+ will do argc -= optind; argv += optind; then
+ argc will be equal to number of remaining non-option
+ arguments, first one would be in argv[0], next in argv[1] and so on
+ (options and their parameters will be moved into argv[]
+ positions prior to argv[optind]).
+
":" If one of the options requires an argument, then add a ":"
after the char in applet_opts and provide a pointer to store
the argument. For example: