static void show_option_values(struct fio_option *o)
{
- const char *msg;
int i = 0;
do {
- msg = o->posval[i].ival;
- if (!msg)
- break;
+ const struct value_pair *vp = &o->posval[i];
- if (!i)
- printf("%20s: ", "valid values");
+ if (!vp->ival)
+ break;
- printf("%s,", msg);
+ printf("%20s: %-10s", i == 0 ? "valid values" : "", vp->ival);
+ if (vp->help)
+ printf(" %s", vp->help);
+ printf("\n");
i++;
} while (i < PARSE_MAX_VP);
ptr2 = strchr(ptr, ',');
if (!ptr2)
ptr2 = strchr(ptr, ':');
+ if (!ptr2)
+ ptr2 = strchr(ptr, '-');
}
/*
"no argument (opt)",
};
+ if (o->alias)
+ printf("%20s: %s\n", "alias", o->alias);
+
printf("%20s: %s\n", "type", typehelp[o->type]);
printf("%20s: %s\n", "default", o->def ? o->def : "no default");
show_option_range(o);
int match = 0;
if (name) {
- if (!strcmp(name, o->name))
+ if (!strcmp(name, o->name) ||
+ (o->alias && !strcmp(name, o->alias)))
match = 1;
else {
unsigned int dist;
if (show_all || match) {
found = 1;
- printf("%20s: %s\n", o->name, o->help);
- if (show_all)
+ if (match)
+ printf("%20s: %s\n", o->name, o->help);
+ if (show_all) {
+ printf("%-20s: %s\n", o->name, o->help);
continue;
+ }
}
if (!match)