summaryrefslogtreecommitdiff
path: root/libshouldbeinlibc/argp-parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'libshouldbeinlibc/argp-parse.c')
-rw-r--r--libshouldbeinlibc/argp-parse.c7
1 files changed, 6 insertions, 1 deletions
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))
{