It only displayed the first found. Add a ->parent_seen and
find all matches.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
{
struct fio_option *__o;
{
struct fio_option *__o;
- for (__o = &options[0]; __o->name; __o++)
- if (__o->parent && !strcmp(__o->parent, o->name))
+ for (__o = &options[0]; __o->name; __o++) {
+ if (__o->parent && !strcmp(__o->parent, o->name)
+ && !__o->parent_seen) {
+ __o->parent_seen = 1;
return NULL;
}
static void print_option(struct fio_option *options, struct fio_option *o,
return NULL;
}
static void print_option(struct fio_option *options, struct fio_option *o,
+ struct fio_option *org, int level)
- for (i = 0; i < level; i++)
p += sprintf(p, "%s", " ");
sprintf(p, "%s", o->name);
printf("%-24s: %s\n", name, o->help);
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(options, find_child(options, org), org, level + 1);
}
int show_cmd_help(struct fio_option *options, const char *name)
}
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)
printf("%24s: %s\n", o->name, o->help);
if (show_all) {
if (!o->parent)
- print_option(options, o, 0);
+ print_option(options, o, NULL, 0);
const char *def; /* default setting */
const struct value_pair posval[PARSE_MAX_VP];/* possible values */
const char *parent; /* parent option */
const char *def; /* default setting */
const struct value_pair posval[PARSE_MAX_VP];/* possible values */
const char *parent; /* parent option */
};
typedef int (str_cb_fn)(void *, char *);
};
typedef int (str_cb_fn)(void *, char *);