Don't require 'all' argument to --cmdhelp to dump all options
[fio.git] / parse.c
diff --git a/parse.c b/parse.c
index 11d745f15649ddd40e2aab2baca52582802ab2b3..ee7ddf29d4605cc29d6aaabdd43420ad868cfde1 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -197,9 +197,6 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
                const struct value_pair *vp;
                int i;
 
-               if (!first)
-                       break;
-
                ret = 1;
                for (i = 0; i < PARSE_MAX_VP; i++) {
                        vp = &o->posval[i];
@@ -366,7 +363,9 @@ static int handle_option(struct fio_option *o, const char *ptr, void *data)
         * Do this before parsing the first round, to check if we should
         * copy set 1 options to set 2.
         */
-       if (ptr && (o->type != FIO_OPT_STR_STORE)) {
+       if (ptr &&
+           (o->type != FIO_OPT_STR_STORE) &&
+           (o->type != FIO_OPT_STR)) {
                ptr2 = strchr(ptr, ',');
                if (!ptr2)
                        ptr2 = strchr(ptr, ':');
@@ -440,7 +439,6 @@ int parse_option(const char *opt, struct fio_option *options, void *data)
 
 int show_cmd_help(struct fio_option *options, const char *name)
 {
-       int show_all = !strcmp(name, "all");
        const char *typehelp[] = {
                "string (opt=bla)",
                "string with possible k/m/g postfix (opt=4k)",
@@ -454,9 +452,16 @@ int show_cmd_help(struct fio_option *options, const char *name)
        };
        struct fio_option *o;
        int found = 0;
+       int show_all = 0;
+
+       if (!name || !strcmp(name, "all"))
+               show_all = 1;
 
        for (o = &options[0]; o->name; o++) {
-               int match = !strcmp(name, o->name);
+               int match = 0;
+
+               if (name && !strcmp(name, o->name))
+                       match = 1;
 
                if (show_all || match) {
                        found = 1;