diff options
author | Miles Bader <miles@gnu.org> | 1996-02-29 00:47:23 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1996-02-29 00:47:23 +0000 |
commit | d5828203ce859f6cb1fb2339645dc38b929b1e04 (patch) | |
tree | 5ca837a448fcda48b86302933d0a42115a54f42c /libshouldbeinlibc/argp-parse.c | |
parent | c91f0da23c0d5a1f71575a2c258c9a4233c0540c (diff) |
(argp_parse): Print an error message if appropiate when we know there are too
many arguments.
Diffstat (limited to 'libshouldbeinlibc/argp-parse.c')
-rw-r--r-- | libshouldbeinlibc/argp-parse.c | 7 |
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)) { |