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