find:: get rid of nested function (it's a gcc-ism)
[oweals/busybox.git] / miscutils / rfkill.c
index 0f5817b76b047b296f2cdc3337c70e04296bd096..4671973713761bbc3f53462aae4bacdf596ca8ed 100644 (file)
@@ -4,8 +4,21 @@
 *
 * Copyright (C) 2010  Malek Degachi <malek-degachi@laposte.net>
 *
-* Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
+* Licensed under GPLv2 or later, see file LICENSE in this source tree.
 */
+
+//usage:#define rfkill_trivial_usage
+//usage:       "COMMAND [INDEX|TYPE]"
+//usage:#define rfkill_full_usage "\n\n"
+//usage:       "Enable/disable wireless devices\n"
+//usage:       "\nCommands:"
+//usage:     "\n       list [INDEX|TYPE]       List current state"
+//usage:     "\n       block INDEX|TYPE        Disable device"
+//usage:     "\n       unblock INDEX|TYPE      Enable device"
+//usage:     "\n"
+//usage:     "\n       TYPE: all, wlan(wifi), bluetooth, uwb(ultrawideband),"
+//usage:     "\n               wimax, wwan, gps, fm"
+
 #include "libbb.h"
 #include <linux/rfkill.h>
 
@@ -53,7 +66,7 @@ int rfkill_main(int argc UNUSED_PARAM, char **argv)
                        rf_name = "uwb";
                rf_type = index_in_strings(rfkill_types, rf_name);
                if (rf_type < 0) {
-                       rf_idx = xatoi_u(rf_name);
+                       rf_idx = xatoi_positive(rf_name);
                }
        }