From d5828203ce859f6cb1fb2339645dc38b929b1e04 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Thu, 29 Feb 1996 00:47:23 +0000 Subject: (argp_parse): Print an error message if appropiate when we know there are too many arguments. --- libshouldbeinlibc/argp-parse.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libshouldbeinlibc/argp-parse.c') diff --git a/libshouldbeinlibc/argp-parse.c b/libshouldbeinlibc/argp-parse.c index 315d6dbc..386fe3ab 100644 --- a/libshouldbeinlibc/argp-parse.c +++ b/libshouldbeinlibc/argp-parse.c @@ -486,7 +486,12 @@ argp_parse (const struct argp *argp, int argc, char **argv, unsigned flags, *end_index = state.next; else /* No way to return the remaining arguments, they must be bogus. */ - err = EINVAL; + { + if (! (state.flags & ARGP_NO_HELP)) + fprintf (stderr, "%s: Too many arguments\n", + program_invocation_name); + err = EINVAL; + } if (err && !(state.flags & ARGP_NO_HELP)) { -- cgit v1.2.3