diff options
author | Miles Bader <miles@gnu.org> | 1997-05-26 02:51:47 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1997-05-26 02:51:47 +0000 |
commit | a0edb1cc02363443ec4d08b177f941f311d8d30c (patch) | |
tree | 4ce7f9dfbf134685fc0cde1f5ba4ceee735386a6 | |
parent | 96ccc9bfe13a633402831e5433887c1821ca445e (diff) |
(parser_init):
For the special case where no parsing function is supplied for an argp,
propagate its input to its first child, if any.
-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) |