]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
Help text: output rfkill type names from an array instead of a static string.
authorDarren Salt <linux@youmustbejoking.demon.co.uk>
Mon, 25 Jan 2010 22:33:30 +0000 (22:33 +0000)
committerJohannes Berg <johannes@sipsolutions.net>
Tue, 26 Jan 2010 06:40:00 +0000 (07:40 +0100)
rfkill.c

index 8fa4c6a0efa13cac1c3bf813f6bc1ef0a4512e04..bda649a978da31ebbb957576820736c7ba1fa76e 100644 (file)
--- a/rfkill.c
+++ b/rfkill.c
@@ -291,6 +291,8 @@ static const char *argv0;
 
 static void usage(void)
 {
+       const struct rfkill_type_str *p;
+
        fprintf(stderr, "Usage:\t%s [options] command\n", argv0);
        fprintf(stderr, "Options:\n");
        fprintf(stderr, "\t--version\tshow version (%s)\n", rfkill_version);
@@ -301,7 +303,10 @@ static void usage(void)
        fprintf(stderr, "\tblock IDENTIFIER\n");
        fprintf(stderr, "\tunblock IDENTIFIER\n");
        fprintf(stderr, "where IDENTIFIER is the index no. of an rfkill switch or one of:\n");
-       fprintf(stderr, "\t<idx> all wifi wlan bluetooth uwb ultrawideband wimax wwan gps\n");
+       fprintf(stderr, "\t<idx>");
+       for (p = rfkill_type_strings; p->name != NULL; p++)
+               fprintf(stderr, " %s", p->name);
+       fprintf(stderr, "\n");
 }
 
 static void version(void)