diff options
-rw-r--r-- | libshouldbeinlibc/argp-parse.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libshouldbeinlibc/argp-parse.c b/libshouldbeinlibc/argp-parse.c index a80f9871..582d1029 100644 --- a/libshouldbeinlibc/argp-parse.c +++ b/libshouldbeinlibc/argp-parse.c @@ -548,6 +548,14 @@ parser_init (struct parser *parser, const struct argp *argp, if (group->parent) /* If a child parser, get the initial input value from the parent. */ group->input = group->parent->child_inputs[group->parent_index]; + + if (!group->parser + && group->argp->children && group->argp->children->argp) + /* For the special case where no parsing function is supplied for an + argp, propagate its input to its first child, if any (this just + makes very simple wrapper argps more convenient). */ + group->child_inputs[0] = group->input; + err = group_parse (group, &parser->state, ARGP_KEY_INIT, 0); } if (err == EBADKEY) |