X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=parse.c;h=086f7864b8b6eb16ee0aa6527e86a32079833bfd;hp=ec0f8707344191e51d03860f35345456e4717272;hb=5e62565b99c2d133e71cf7eed8586307452ad225;hpb=d220c761f78bc04bf34355560a0b6b7b85fba0e8;ds=sidebyside diff --git a/parse.c b/parse.c index ec0f8707..086f7864 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) { @@ -1232,8 +1252,10 @@ 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); if (o->type == FIO_OPT_BOOL) { o->minval = 0; o->maxval = 1;