| 69 | |
| 70 | |
| 71 | static void print_usage(const char *badoption) { |
| 72 | lua_writestringerror("%s: ", progname); |
| 73 | if (badoption[1] == 'e' || badoption[1] == 'l') |
| 74 | lua_writestringerror("'%s' needs argument\n", badoption); |
| 75 | else |
| 76 | lua_writestringerror("unrecognized option '%s'\n", badoption); |
| 77 | lua_writestringerror( |
| 78 | "usage: %s [options] [script [args]]\n" |
| 79 | "Available options are:\n" |
| 80 | " -e stat execute string 'stat'\n" |
| 81 | " -i enter interactive mode after executing 'script'\n" |
| 82 | " -l name require library 'name'\n" |
| 83 | " -v show version information\n" |
| 84 | " -E ignore environment variables\n" |
| 85 | " -d decompile bytecode to source\n" |
| 86 | " -s disassemble bytecode to readable assemble\n" |
| 87 | " -c compile source to bytecode\n" |
| 88 | " -- stop handling options\n" |
| 89 | " - stop handling options and execute stdin\n" |
| 90 | , |
| 91 | progname); |
| 92 | } |
| 93 | |
| 94 | |
| 95 | /* |