X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=parse.c;h=8ed4619e6e08f765b783e3c59f3bf7b5632faf2d;hp=ec0f8707344191e51d03860f35345456e4717272;hb=7790f697c858f9f471234d1ec244465a1fc0f8f2;hpb=d220c761f78bc04bf34355560a0b6b7b85fba0e8 diff --git a/parse.c b/parse.c index ec0f8707..8ed4619e 100644 --- a/parse.c +++ b/parse.c @@ -109,6 +109,7 @@ static void show_option_help(struct fio_option *o, int is_err) "list of floating point values separated by ':' (opt=5.9:7.8)", "no argument (opt)", "deprecated", + "unsupported", }; size_t (*logger)(const char *format, ...); @@ -906,6 +907,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) { @@ -1230,10 +1250,12 @@ void fill_default_options(void *data, struct fio_option *options) handle_option(o, o->def, data); } -void option_init(struct fio_option *o) +static 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); if (o->type == FIO_OPT_BOOL) { o->minval = 0; o->maxval = 1;