Rework 'dump_cmdline'
[fio.git] / parse.c
diff --git a/parse.c b/parse.c
index e330deae2c805602be5b5df5f4c462c0f773c9e0..df42e227477e14f5082da58741a3a107e5d341f5 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -978,7 +978,7 @@ int parse_cmd_option(const char *opt, const char *val,
 
 int parse_option(char *opt, const char *input,
                 struct fio_option *options, struct fio_option **o, void *data,
-                int dump_cmdline)
+                struct flist_head *dump_list)
 {
        char *post;
 
@@ -1004,17 +1004,16 @@ int parse_option(char *opt, const char *input,
                return 1;
        }
 
-       if (dump_cmdline) {
-               const char *delim;
+       if (dump_list) {
+               struct print_option *p = malloc(sizeof(*p));
 
-               if (!strcmp("description", (*o)->name))
-                       delim = "\"";
+               p->name = strdup((*o)->name);
+               if (post)
+                       p->value = strdup(post);
                else
-                       delim = "";
+                       p->value = NULL;
 
-               log_info("--%s%s", (*o)->name, post ? "" : " ");
-               if (post)
-                       log_info("=%s%s%s ", delim, post, delim);
+               flist_add_tail(&p->list, dump_list);
        }
 
        return 0;