Browse Source

flag for direct execution is "-e"; argument with an "=" goes to

direct execution, independently of flags.
v5-2
Roberto Ierusalimschy 29 years ago
parent
commit
6336d2f9e1
  1. 5
      lua.c

5
lua.c

@ -39,7 +39,6 @@ int main (int argc, char *argv[])
iolib_open ();
strlib_open ();
mathlib_open ();
if (argc < 2)
manual_input();
else for (i=1; i<argc; i++) {
@ -48,8 +47,8 @@ int main (int argc, char *argv[])
else if (strcmp(argv[i], "-v") == 0)
printf("%s %s\n(written by %s)\n\n",
LUA_VERSION, LUA_COPYRIGHT, LUA_AUTHORS);
else if (strcmp(argv[i], "-x") == 0) {
if (lua_dostring(argv[++i]) != 0) {
else if ((strcmp(argv[i], "-e") == 0 && i++) || strchr(argv[i], '=')) {
if (lua_dostring(argv[i]) != 0) {
fprintf(stderr, "lua: error running argument `%s'\n", argv[i]);
return 1;
}

Loading…
Cancel
Save