aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-05-11 00:02:39 +0000
committerMike Frysinger <vapier@gentoo.org>2005-05-11 00:02:39 +0000
commitfb6d22c96c1147014294b30c97e7b912db36bfed (patch)
tree06d2600f13adad2c68b310da1f961dc9c96990e7
parent00e76cb6b98062eaef61e56a6be1bb7f26ad2fc9 (diff)
downloadbusybox-w32-fb6d22c96c1147014294b30c97e7b912db36bfed.tar.gz
busybox-w32-fb6d22c96c1147014294b30c97e7b912db36bfed.tar.bz2
busybox-w32-fb6d22c96c1147014294b30c97e7b912db36bfed.zip
now that mjn3 explained it to me, add documentation for the 3rd field in long opts
-rw-r--r--libbb/getopt_ulflags.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/libbb/getopt_ulflags.c b/libbb/getopt_ulflags.c
index 86cf45325..b6a35261d 100644
--- a/libbb/getopt_ulflags.c
+++ b/libbb/getopt_ulflags.c
@@ -80,13 +80,20 @@ static const struct option bb_default_long_options[]
80 }; 80 };
81 bb_applet_long_options = applet_long_options; 81 bb_applet_long_options = applet_long_options;
82 82
83 The first parameter is the long option that you would pass to 83 The first parameter is the long option name that you would pass
84 the applet (--verbose) in place of the short option (-v). The 84 to the applet (without the dashes).
85 second field determines whether the option has an argument. 85
86 The second field determines whether the option has an argument.
86 You can set this to 0, 1, or 2, or you can use the long named 87 You can set this to 0, 1, or 2, or you can use the long named
87 defines of no_argument, required_argument, and optional_argument. 88 defines of no_argument, required_argument, and optional_argument.
88 Just set the third argument to '0' or 'NULL'. The last argument 89
89 is simply the short option without the dash of course. 90 The third argument is used only when the long option does not
91 have a corresponding short option. In that case, it should be
92 an integer pointer. Otherwise (and normally), it should just
93 bet set to NULL.
94
95 The last argument is the corresponding short option (if there
96 is one of course).
90 97
91 Note: a good applet will make long options configurable via the 98 Note: a good applet will make long options configurable via the
92 config process and not a required feature. The current standard 99 config process and not a required feature. The current standard