lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> It reports progname with the badoption error even if that error is
> "unrecognized option" rather than "needs argument".

Lua 5.2.0-alpha already does that. As far I as can see, the patch
simply replaces the original code

  if (badoption[1] == 'e' || badoption[1] == 'l') {
    luai_writestringerror("%s: ", progname);
    luai_writestringerror("'%s' needs argument\n", badoption);
  } else {
    luai_writestringerror("%s: ", progname);
    luai_writestringerror("unrecognized option '%s'\n", badoption);
  }

with

  luai_writestringerror("%s: ", progname);
  if (badoption[1] == 'e' || badoption[1] == 'l')
    luai_writestringerror("'%s' needs argument\n", badoption);
  else
    luai_writestringerror("unrecognized option '%s'\n", badoption);

thus saving one or two lines.

Thanks for the patch anyway.