* src/emacs.c (sort_args): Warn about multiple matches.
authorGlenn Morris <rgm@gnu.org>
Tue, 15 Nov 2016 22:14:27 +0000 (17:14 -0500)
committerGlenn Morris <rgm@gnu.org>
Tue, 15 Nov 2016 22:14:27 +0000 (17:14 -0500)
src/emacs.c

index b74df21196ae2f47dd8a20d1b2152dea1f11dbf2..75328c5e3e01a398d8fc7813f6e00f867a5f9d5c 100644 (file)
@@ -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: ;
        }