| 81 | |
| 82 | |
| 83 | static void print_usage (const char *badoption) { |
| 84 | lua_writestringerror("%s: ", progname); |
| 85 | if (badoption[1] == 'e' || badoption[1] == 'l') |
| 86 | lua_writestringerror("'%s' needs argument\n", badoption); |
| 87 | else |
| 88 | lua_writestringerror("unrecognized option '%s'\n", badoption); |
| 89 | lua_writestringerror( |
| 90 | "usage: %s [options] [script [args]]\n" |
| 91 | "Available options are:\n" |
| 92 | " -e stat execute string 'stat'\n" |
| 93 | " -i enter interactive mode after executing 'script'\n" |
| 94 | " -l mod require library 'mod' into global 'mod'\n" |
| 95 | " -l g=mod require library 'mod' into global 'g'\n" |
| 96 | " -v show version information\n" |
| 97 | " -E ignore environment variables\n" |
| 98 | " -W turn warnings on\n" |
| 99 | " -- stop handling options\n" |
| 100 | " - stop handling options and execute stdin\n" |
| 101 | , |
| 102 | progname); |
| 103 | } |
| 104 | |
| 105 | |
| 106 | /* |