X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=parse.c;h=5347f675b07e6d7a88d6a6ade63bbcd0574f129b;hp=2e8a2a520f3906a66e608a7900f02c7a8f534221;hb=15f7918ff432d5da2b2abc84a50c685bde5e72ef;hpb=facba0e53b7108d70f34e3eb01b54c2efd73f5f4;ds=inline diff --git a/parse.c b/parse.c index 2e8a2a52..5347f675 100644 --- a/parse.c +++ b/parse.c @@ -366,6 +366,38 @@ int parse_option(const char *opt, struct fio_option *options, void *data) return 1; } +static void show_option_range(struct fio_option *o) +{ + if (!o->minval && !o->maxval) + return; + + printf("%16s: min=%d, max=%d\n", "range", o->minval, o->maxval); +} + +static void show_option_values(struct fio_option *o) +{ + const char *msg; + int i = 0; + + if (!o->posval) + return; + + do { + msg = o->posval[i]; + if (!msg) + break; + + if (!i) + printf("%16s: ", "valid values"); + + printf("%s,", msg); + i++; + } while (1); + + if (i) + printf("\n"); +} + int show_cmd_help(struct fio_option *options, const char *name) { int show_all = !strcmp(name, "all"); @@ -391,6 +423,8 @@ int show_cmd_help(struct fio_option *options, const char *name) if (match) { printf("%16s: %s\n", "type", typehelp[o->type]); printf("%16s: %s\n", "default", o->def ? o->def : "no default"); + show_option_range(o); + show_option_values(o); } }