From 9ed2502878d16ed7f20e8b4817e1eed963468de7 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 15 Nov 2016 17:14:27 -0500 Subject: [PATCH] * src/emacs.c (sort_args): Warn about multiple matches. --- src/emacs.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/emacs.c b/src/emacs.c index b74df21196a..75328c5e3e0 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1870,9 +1870,13 @@ sort_args (int argc, char **argv) fatal ("Option '%s' requires an argument\n", argv[from]); from += options[from]; } - /* FIXME When match < 0, shouldn't there be some error, - or at least indication to the user that there was a - problem? */ + else if (match == -2) + { + /* This is an internal error. + Eg if one long option is a prefix of another. */ + fprintf (stderr, "Option '%s' matched multiple standard arguments\n", argv[from]); + } + /* Should we not also warn if there was no match? */ } done: ; } -- 2.39.5