[BusyBox-cvs] svn commit: trunk/busybox/libbb
vapier at busybox.net
vapier at busybox.net
Wed May 11 00:02:39 UTC 2005
Author: vapier
Date: 2005-05-10 18:02:39 -0600 (Tue, 10 May 2005)
New Revision: 10287
Log:
now that mjn3 explained it to me, add documentation for the 3rd field in long opts
Modified:
trunk/busybox/libbb/getopt_ulflags.c
Changeset:
Modified: trunk/busybox/libbb/getopt_ulflags.c
===================================================================
--- trunk/busybox/libbb/getopt_ulflags.c 2005-05-10 23:53:33 UTC (rev 10286)
+++ trunk/busybox/libbb/getopt_ulflags.c 2005-05-11 00:02:39 UTC (rev 10287)
@@ -80,14 +80,21 @@
};
bb_applet_long_options = applet_long_options;
- The first parameter is the long option that you would pass to
- the applet (--verbose) in place of the short option (-v). The
- second field determines whether the option has an argument.
+ The first parameter is the long option name that you would pass
+ to the applet (without the dashes).
+
+ The second field determines whether the option has an argument.
You can set this to 0, 1, or 2, or you can use the long named
defines of no_argument, required_argument, and optional_argument.
- Just set the third argument to '0' or 'NULL'. The last argument
- is simply the short option without the dash of course.
+ The third argument is used only when the long option does not
+ have a corresponding short option. In that case, it should be
+ an integer pointer. Otherwise (and normally), it should just
+ bet set to NULL.
+
+ The last argument is the corresponding short option (if there
+ is one of course).
+
Note: a good applet will make long options configurable via the
config process and not a required feature. The current standard
is to name the config option CONFIG_FEATURE_<applet>_LONG_OPTIONS.
More information about the busybox-cvs
mailing list