Warn if default value is given for string option without value
authorJens Axboe <jens.axboe@oracle.com>
Tue, 20 Mar 2007 13:28:34 +0000 (14:28 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 20 Mar 2007 13:28:34 +0000 (14:28 +0100)
That would not make sense, as the option would then always be set
and there would be no way to unset it.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
parse.c

diff --git a/parse.c b/parse.c
index 4d8e95db7fbe88b84a45c7bb215b1b7f3db47223..57865b112e7a9118a9a4e6fc3dd0a60a0d66a9a8 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -625,6 +625,8 @@ void options_init(struct fio_option *options)
                        o->minval = 0;
                        o->maxval = 1;
                }
+               if (o->type == FIO_OPT_STR_SET && o->def)
+                       fprintf(stderr, "Option %s: string set option with default will always be true\n", o->name);
                if (!o->cb && !o->off1)
                        fprintf(stderr, "Option %s: neither cb nor offset given\n", o->name);
                if (o->type == FIO_OPT_STR || o->type == FIO_OPT_STR_STORE)