{
if (!strlen(p))
return 1;
- if (strstr(p, "0x")) {
+ if (strstr(p, "0x") || strstr(p, "0X")) {
if (sscanf(p, "%x", val) == 1)
return 0;
} else {
{
struct fio_option *__o;
- for (__o = &options[0]; __o->name; __o++)
+ for (__o = options + 1; __o->name; __o++)
if (__o->parent && !strcmp(__o->parent, o->name))
return __o;
return NULL;
}
-static void print_option(struct fio_option *options, struct fio_option *o,
+static void print_option(struct fio_option *o, struct fio_option *org,
int level)
{
char name[256], *p;
- int i;
if (!o)
return;
+ if (!org)
+ org = o;
p = name;
- for (i = 0; i < level; i++)
+ if (level)
p += sprintf(p, "%s", " ");
sprintf(p, "%s", o->name);
printf("%-24s: %s\n", name, o->help);
- print_option(options, find_child(options, o), level + 1);
+ print_option(find_child(o, org), org, level + 1);
}
int show_cmd_help(struct fio_option *options, const char *name)
printf("%24s: %s\n", o->name, o->help);
if (show_all) {
if (!o->parent)
- print_option(options, o, 0);
+ print_option(o, NULL, 0);
continue;
}
}