diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-08-20 13:42:26 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-08-20 13:42:26 -0300 |
| commit | be78aeae4c429d7d68af3a3e1b0cf8e52fcff160 (patch) | |
| tree | e81d25014e238f589997f109ba10a875c3a875dc /lua.c | |
| parent | 5bc47fe83087e0686f4639d031801837846e4c65 (diff) | |
| download | lua-be78aeae4c429d7d68af3a3e1b0cf8e52fcff160.tar.gz lua-be78aeae4c429d7d68af3a3e1b0cf8e52fcff160.tar.bz2 lua-be78aeae4c429d7d68af3a3e1b0cf8e52fcff160.zip | |
Default for warnings changed to "off"
Warnings are mostly a tool to help developers (e.g., by showing hidden
error messages); regular users usually don't need to see them.
Diffstat (limited to 'lua.c')
| -rw-r--r-- | lua.c | 10 |
1 files changed, 5 insertions, 5 deletions
| @@ -73,7 +73,7 @@ static void print_usage (const char *badoption) { | |||
| 73 | " -l name require library 'name' into global 'name'\n" | 73 | " -l name require library 'name' into global 'name'\n" |
| 74 | " -v show version information\n" | 74 | " -v show version information\n" |
| 75 | " -E ignore environment variables\n" | 75 | " -E ignore environment variables\n" |
| 76 | " -q turn warnings off\n" | 76 | " -W turn warnings on\n" |
| 77 | " -- stop handling options\n" | 77 | " -- stop handling options\n" |
| 78 | " - stop handling options and execute stdin\n" | 78 | " - stop handling options and execute stdin\n" |
| 79 | , | 79 | , |
| @@ -264,7 +264,7 @@ static int collectargs (char **argv, int *first) { | |||
| 264 | return has_error; /* invalid option */ | 264 | return has_error; /* invalid option */ |
| 265 | args |= has_E; | 265 | args |= has_E; |
| 266 | break; | 266 | break; |
| 267 | case 'q': | 267 | case 'W': |
| 268 | if (argv[i][2] != '\0') /* extra characters? */ | 268 | if (argv[i][2] != '\0') /* extra characters? */ |
| 269 | return has_error; /* invalid option */ | 269 | return has_error; /* invalid option */ |
| 270 | break; | 270 | break; |
| @@ -295,7 +295,7 @@ static int collectargs (char **argv, int *first) { | |||
| 295 | 295 | ||
| 296 | /* | 296 | /* |
| 297 | ** Processes options 'e' and 'l', which involve running Lua code, and | 297 | ** Processes options 'e' and 'l', which involve running Lua code, and |
| 298 | ** 'q', which also affects the state. | 298 | ** 'W', which also affects the state. |
| 299 | ** Returns 0 if some code raises an error. | 299 | ** Returns 0 if some code raises an error. |
| 300 | */ | 300 | */ |
| 301 | static int runargs (lua_State *L, char **argv, int n) { | 301 | static int runargs (lua_State *L, char **argv, int n) { |
| @@ -315,8 +315,8 @@ static int runargs (lua_State *L, char **argv, int n) { | |||
| 315 | if (status != LUA_OK) return 0; | 315 | if (status != LUA_OK) return 0; |
| 316 | break; | 316 | break; |
| 317 | } | 317 | } |
| 318 | case 'q': | 318 | case 'W': |
| 319 | lua_warning(L, "@off", 0); /* no warnings */ | 319 | lua_warning(L, "@on", 0); /* warnings on */ |
| 320 | break; | 320 | break; |
| 321 | } | 321 | } |
| 322 | } | 322 | } |
