From a0edb1cc02363443ec4d08b177f941f311d8d30c Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Mon, 26 May 1997 02:51:47 +0000 Subject: (parser_init): For the special case where no parsing function is supplied for an argp, propagate its input to its first child, if any. --- libshouldbeinlibc/argp-parse.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libshouldbeinlibc/argp-parse.c') 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) -- cgit v1.2.3