options: strip off =optval when matching
Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/options.c b/options.c
index 98f4b2b..2c703fd 100644
--- a/options.c
+++ b/options.c
@@ -3933,10 +3933,20 @@
return opts_copy;
}
-static void show_closest_option(const char *name)
+static void show_closest_option(const char *opt)
{
int best_option, best_distance;
int i, distance;
+ char *name;
+
+ if (!strlen(opt))
+ return;
+
+ name = strdup(opt);
+ i = 0;
+ while (name[i] != '\0' && name[i] != '=')
+ i++;
+ name[i] = '\0';
best_option = -1;
best_distance = INT_MAX;
@@ -3952,6 +3962,8 @@
if (best_option != -1)
log_err("Did you mean %s?\n", fio_options[best_option].name);
+
+ free(name);
}
int fio_options_parse(struct thread_data *td, char **opts, int num_opts,