[PATCH] Show allowed option values for string matching
[fio.git] / init.c
diff --git a/init.c b/init.c
index 4add942ef823ea2fe776aab45b32ecfb0c7da263..11fd3e283f0c2f7026b68cca1e825515085d8b6a 100644 (file)
--- a/init.c
+++ b/init.c
@@ -63,29 +63,35 @@ static struct fio_option options[] = {
                .name   = "rw",
                .type   = FIO_OPT_STR,
                .cb     = str_rw_cb,
-               .help   = "IO direction (read, write, rw, etc)",
+               .help   = "IO direction",
                .def    = "read",
+               .posval = { "read", "write", "randwrite", "randread", "rw",
+                               "randrw", },
        },
        {
                .name   = "ioengine",
                .type   = FIO_OPT_STR,
                .cb     = str_ioengine_cb,
-               .help   = "IO engine to use (sync, aio, etc)",
+               .help   = "IO engine to use",
                .def    = "sync",
+               .posval = { "sync", "libaio", "posixaio", "mmap", "splice",
+                               "sg", "null", },
        },
        {
                .name   = "mem",
                .type   = FIO_OPT_STR,
                .cb     = str_mem_cb,
-               .help   = "Backing type for IO buffers (malloc, shm, etc)",
+               .help   = "Backing type for IO buffers",
                .def    = "malloc",
+               .posval =  { "malloc", "shm", "shmhuge", "mmap", "mmaphuge", },
        },
        {
                .name   = "verify",
                .type   = FIO_OPT_STR,
                .cb     = str_verify_cb,
-               .help   = "Verify sum function (md5 or crc32)",
+               .help   = "Verify sum function",
                .def    = "0",
+               .posval = { "crc32", "md5", },
        },
        {
                .name   = "write_iolog",
@@ -226,6 +232,7 @@ static struct fio_option options[] = {
                .type   = FIO_OPT_INT,
                .off1   = td_var_offset(nice),
                .help   = "Set job CPU nice value",
+               .minval = -19,
                .maxval = 20,
                .def    = "0",
        },
@@ -235,12 +242,16 @@ static struct fio_option options[] = {
                .type   = FIO_OPT_INT,
                .cb     = str_prio_cb,
                .help   = "Set job IO priority value",
+               .minval = 0,
+               .maxval = 7,
        },
        {
                .name   = "prioclass",
                .type   = FIO_OPT_INT,
                .cb     = str_prioclass_cb,
                .help   = "Set job IO priority class",
+               .minval = 0,
+               .maxval = 3,
        },
 #endif
        {
@@ -273,7 +284,7 @@ static struct fio_option options[] = {
                .name   = "ratecycle",
                .type   = FIO_OPT_INT,
                .off1   = td_var_offset(ratecycle),
-               .name   = "Window average for rate limits (msec)",
+               .help   = "Window average for rate limits (msec)",
                .def    = "1000",
        },
        {