diff --git a/lib/texpect/texpect.c b/lib/texpect/texpect.c index 5657efa44d1..1a6ebf486ae 100644 --- a/lib/texpect/texpect.c +++ b/lib/texpect/texpect.c @@ -388,7 +388,13 @@ int main(int argc, const char **argv) } while ((optidx = poptGetNextOpt(pc)) != -1) { - ;; + switch (optidx) { + case POPT_ERROR_BADOPT: + fprintf(stderr, "\nInvalid option %s: %s\n\n", + poptBadOption(pc, 0), poptStrerror(optidx)); + poptPrintUsage(pc, stderr, 0); + exit(1); + } } instruction_file = poptGetArg(pc);