summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2016-06-08 10:58:07 -0600
committerJens Axboe <axboe@fb.com>2016-06-08 10:58:07 -0600
commit75e6bcba7e5824b8852590fa54963db64f05c70d (patch)
treea1797439faebafdcb875f37e4536a6052b75aec5 /parse.c
parent6a89b401289ef823c51760c71018b43d0c17532b (diff)
downloadfio-75e6bcba7e5824b8852590fa54963db64f05c70d.tar.gz
fio-75e6bcba7e5824b8852590fa54963db64f05c70d.tar.bz2
parse: add support for unsupported options
Some options are only available if fio is built with a certain set of libraries. This can confuse the user. Add support for listing an unsupported option, so fio can print some related help for that option. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/parse.c b/parse.c
index 963f1f8c..bb16bc16 100644
--- a/parse.c
+++ b/parse.c
@@ -906,6 +906,25 @@ static int handle_option(struct fio_option *o, const char *__ptr, void *data)
return ret;
}
+struct fio_option *find_option(struct fio_option *options, const char *opt)
+{
+ struct fio_option *o;
+
+ for (o = &options[0]; o->name; o++) {
+ if (!o_match(o, opt))
+ continue;
+ if (o->type == FIO_OPT_UNSUPPORTED) {
+ log_err("Option <%s>: %s\n", o->name, o->help);
+ continue;
+ }
+
+ return o;
+ }
+
+ return NULL;
+}
+
+
static struct fio_option *get_option(char *opt,
struct fio_option *options, char **post)
{
@@ -1232,7 +1251,7 @@ void fill_default_options(void *data, struct fio_option *options)
void option_init(struct fio_option *o)
{
- if (o->type == FIO_OPT_DEPRECATED)
+ if (o->type == FIO_OPT_DEPRECATED || o->type == FIO_OPT_UNSUPPORTED)
return;
if (o->name && !o->lname)
log_err("Option %s: missing long option name\n", o->name);