summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6a89b40)
Some options are only available if fio is built with a certain
set of libraries. This can confuse the user. Add support for
listing an unsupported option, so fio can print some related help
for that option.
Signed-off-by: Jens Axboe <axboe@fb.com>
- if (best_option != -1 && string_distance_ok(name, best_distance))
+ if (best_option != -1 && string_distance_ok(name, best_distance) &&
+ fio_options[best_option].type != FIO_OPT_UNSUPPORTED)
log_err("Did you mean %s?\n", fio_options[best_option].name);
free(name);
log_err("Did you mean %s?\n", fio_options[best_option].name);
free(name);
-static inline 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))
- return o;
-
- return NULL;
-}
-
-extern struct fio_option *fio_option_find(const char *name);
+extern struct fio_option *find_option(struct fio_option *, const char *);
+extern struct fio_option *fio_option_find(const char *);
extern unsigned int fio_get_kb_base(void *);
#endif
extern unsigned int fio_get_kb_base(void *);
#endif
+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)
{
static struct fio_option *get_option(char *opt,
struct fio_option *options, char **post)
{
void option_init(struct fio_option *o)
{
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);
return;
if (o->name && !o->lname)
log_err("Option %s: missing long option name\n", o->name);
FIO_OPT_FLOAT_LIST,
FIO_OPT_STR_SET,
FIO_OPT_DEPRECATED,
FIO_OPT_FLOAT_LIST,
FIO_OPT_STR_SET,
FIO_OPT_DEPRECATED,