Add suboption help texts
[fio.git] / parse.c
diff --git a/parse.c b/parse.c
index e09b1bbe42998655125d23b00c3b0b7d35214489..5c5d2ad989fc23e627cc17a46ea1e7af70d9f848 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -21,18 +21,18 @@ static void show_option_range(struct fio_option *o)
 
 static void show_option_values(struct fio_option *o)
 {
-       const char *msg;
        int i = 0;
 
        do {
-               msg = o->posval[i].ival;
-               if (!msg)
-                       break;
+               const struct value_pair *vp = &o->posval[i];
 
-               if (!i)
-                       printf("%20s: ", "valid values");
+               if (!vp->ival)
+                       break;
 
-               printf("%s,", msg);
+               printf("%20s: %-10s", i == 0 ? "valid values" : "", vp->ival);
+               if (vp->help)
+                       printf(" %s", vp->help);
+               printf("\n");
                i++;
        } while (i < PARSE_MAX_VP);
 
@@ -537,9 +537,12 @@ int show_cmd_help(struct fio_option *options, const char *name)
 
                if (show_all || match) {
                        found = 1;
-                       printf("%20s: %s\n", o->name, o->help);
-                       if (show_all)
+                       if (match)
+                               printf("%20s: %s\n", o->name, o->help);
+                       if (show_all) {
+                               printf("%-20s: %s\n", o->name, o->help);
                                continue;
+                       }
                }
 
                if (!match)