Fix broken FIO_OPT_STR option
Only break out and show help if the option had ->posval entries.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/parse.c b/parse.c
index cbe8e35..fb5d457 100644
--- a/parse.c
+++ b/parse.c
@@ -289,7 +289,7 @@
fio_opt_str_fn *fn = o->cb;
const struct value_pair *vp;
struct value_pair posval[PARSE_MAX_VP];
- int i;
+ int i, all_skipped = 1;
posval_sort(o, posval);
@@ -298,6 +298,7 @@
vp = &posval[i];
if (!vp->ival || vp->ival[0] == '\0')
continue;
+ all_skipped = 0;
if (!strncmp(vp->ival, ptr, strlen(vp->ival))) {
ret = 0;
if (o->roff1) {
@@ -314,7 +315,7 @@
}
}
- if (ret)
+ if (ret && !all_skipped)
show_option_values(o);
else if (fn)
ret = fn(data, ptr);