Fixes so "make allnoconfig" works again.
[oweals/busybox.git] / libbb / getopt_ulflags.c
index 86cf453250e8a6325cd23a0fac3ba09f83e3c692..6197e8d9f18fc3e421bae25dc9729bddbaab0c5a 100644 (file)
@@ -80,13 +80,20 @@ static const struct option bb_default_long_options[]
            };
            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
@@ -148,10 +155,10 @@ Special characters:
            if specified together.  In this case you must set
            bb_opt_complementaly = "b~cf:c~bf:f~bc".  If two of the
            mutually exclusive options are found, bb_getopt_ulflags's
-           return value will have the error flag set (0x80000000UL) so
+           return value will have the error flag set (BB_GETOPT_ERROR) so
            that we can check for it:
 
-           if (flags & 0x80000000UL)
+           if (flags & BB_GETOPT_ERROR)
                    bb_show_usage();
 
    "*"     A star after a char in bb_opt_complementaly means that the
@@ -273,7 +280,7 @@ bb_getopt_ulflags (int argc, char **argv, const char *applet_opts, ...)
                                bb_show_usage ();
                }
                if(flags & on_off->incongruously)
-                       flags |= 0x80000000UL;
+                       flags |= BB_GETOPT_ERROR;
                flags &= ~on_off->switch_off;
                flags |= on_off->switch_on;
                if(on_off->list_flg) {