init: allow FIO_OPT_STR_SET options to have an optional argument
authorJens Axboe <axboe@kernel.dk>
Wed, 27 Nov 2013 03:19:59 +0000 (20:19 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 27 Nov 2013 03:19:59 +0000 (20:19 -0700)
Makes them work like a bool.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
options.c

index 4b4c251b92c3e6895d9dafe99c54dc1c9c388147..a700e4da71370838818e755840049f15e08a60f3 100644 (file)
--- a/options.c
+++ b/options.c
@@ -3277,7 +3277,7 @@ static void add_to_lopt(struct option *lopt, struct fio_option *o,
        lopt->name = (char *) name;
        lopt->val = val;
        if (o->type == FIO_OPT_STR_SET)
-               lopt->has_arg = no_argument;
+               lopt->has_arg = optional_argument;
        else
                lopt->has_arg = required_argument;
 }