diff options
Diffstat (limited to 'doc/docs')
| -rwxr-xr-x | doc/docs/doc/README.md | 61 | ||||
| -rwxr-xr-x | doc/docs/zh/doc/README.md | 65 |
2 files changed, 77 insertions, 49 deletions
diff --git a/doc/docs/doc/README.md b/doc/docs/doc/README.md index b5051d4..8569a10 100755 --- a/doc/docs/doc/README.md +++ b/doc/docs/doc/README.md | |||
| @@ -196,29 +196,44 @@ f! | |||
| 196 |  Use YueScript tool with: | 196 |  Use YueScript tool with: |
| 197 | ``` | 197 | ``` |
| 198 | > yue -h | 198 | > yue -h |
| 199 | Usage: yue [options|files|directories] ... | 199 | Usage: yue |
| 200 | 200 | [options] [<file/directory>] ... | |
| 201 | -h Print this message | 201 | yue -e <code_or_file> [args...] |
| 202 | -e str Execute a file or raw codes | 202 | yue -w [<directory>] [options] |
| 203 | -m Generate minified codes | 203 | yue - |
| 204 | -r Rewrite output to match original line numbers | 204 | |
| 205 | -t path Specify where to place compiled files | 205 | Notes: |
| 206 | -o file Write output to file | 206 | - '-' / '--' must be the first and only argument. |
| 207 | -s Use spaces in generated codes instead of tabs | 207 | - '-o/--output' can not be used with multiple input files. |
| 208 | -p Write output to standard out | 208 | - '-w/--watch' can not be used with file input (directory only). |
| 209 | -b Dump compile time (doesn't write output) | 209 | - with '-e/--execute', remaining tokens are treated as script args. |
| 210 | -g Dump global variables used in NAME LINE COLUMN | 210 | |
| 211 | -l Write line numbers from source codes | 211 | Options: |
| 212 | -j Disable implicit return at end of file | 212 | -h, --help Show this help message and exit. |
| 213 | -c Reserve comments before statement from source codes | 213 | -e <str>, --execute <str> Execute a file or raw codes |
| 214 | -w path Watch changes and compile every file under directory | 214 | -m, --minify Generate minified codes |
| 215 | -v Print version | 215 | -r, --rewrite Rewrite output to match original line numbers |
| 216 | -- Read from standard in, print to standard out | 216 | -t <output_to>, --output-to <output_to> |
| 217 | (Must be first and only argument) | 217 | Specify where to place compiled files |
| 218 | 218 | -o <file>, --output <file> Write output to file | |
| 219 | --target=version Specify the Lua version codes the compiler will generate | 219 | -p, --print Write output to standard out |
| 220 | (version can only be 5.1, 5.2, 5.3 or 5.4) | 220 | -b, --benchmark Dump compile time (doesn't write output) |
| 221 | --path=path_str Append an extra Lua search path string to package.path | 221 | -g, --globals Dump global variables used in NAME LINE COLUMN |
| 222 | -s, --spaces Use spaces in generated codes instead of tabs | ||
| 223 | -l, --line-numbers Write line numbers from source codes | ||
| 224 | -j, --no-implicit-return Disable implicit return at end of file | ||
| 225 | -c, --reserve-comments Reserve comments before statement from source codes | ||
| 226 | -w [<dir>], --watch [<dir>] | ||
| 227 | Watch changes and compile every file under directory | ||
| 228 | -v, --version Print version | ||
| 229 | - Read from standard in, print to standard out | ||
| 230 | (Must be first and only argument) | ||
| 231 | -- Same as '-' (kept for backward compatibility) | ||
| 232 | |||
| 233 | --target <version> Specify the Lua version that codes will be generated to | ||
| 234 | (version can only be 5.1 to 5.5) | ||
| 235 | --path <path_str> Append an extra Lua search path string to package.path | ||
| 236 | --<key>=<value> Pass compiler option in key=value form (existing behavior) | ||
| 222 | 237 | ||
| 223 | Execute without options to enter REPL, type symbol '$' | 238 | Execute without options to enter REPL, type symbol '$' |
| 224 | in a single line to start/stop multi-line mode | 239 | in a single line to start/stop multi-line mode |
diff --git a/doc/docs/zh/doc/README.md b/doc/docs/zh/doc/README.md index 43713fe..a3ff7cb 100755 --- a/doc/docs/zh/doc/README.md +++ b/doc/docs/zh/doc/README.md | |||
| @@ -195,32 +195,45 @@ f! | |||
| 195 | 195 | ||
| 196 | 使用月之脚本编译工具: | 196 | 使用月之脚本编译工具: |
| 197 | ``` | 197 | ``` |
| 198 | 使用命令: yue [选项|文件|目录] ... | 198 | 命令行用法: yue |
| 199 | 199 | [选项] [<文件/目录>] ... | |
| 200 | -h 打印此消息 | 200 | yue -e <代码或文件> [参数...] |
| 201 | -e str 执行一个文件或一段原始代码 | 201 | yue -w [<目录>] [选项] |
| 202 | -m 生成压缩后的代码 | 202 | yue - |
| 203 | -r 重写输出的Lua代码以匹配原始代码中的行号 | 203 | |
| 204 | -t path 指定放置编译结果文件的位置 | 204 | 说明: |
| 205 | -o file 将输出写到指定的文件中 | 205 | - '-' 或 '--' 必须作为唯一且第一个参数,用于读取标准输入。 |
| 206 | -s 在生成的代码中使用空格代替制表符 | 206 | - '-o/--output' 不能与多个输入文件一起使用。 |
| 207 | -p 将输出写入标准输出 | 207 | - '-w/--watch' 仅能用于目录,不能用于单个文件。 |
| 208 | -b 输出编译时间(不写输出) | 208 | - 使用 '-e/--execute' 时,后续的参数将作为脚本参数传递。 |
| 209 | -g 以“名称 行号 列号”的形式输出代码中使用的全局变量 | 209 | |
| 210 | -l 在输出的每一行代码的末尾写上原代码的行号 | 210 | 选项: |
| 211 | -j 禁用文件末尾的隐式返回 | 211 | -h, --help 显示帮助信息并退出 |
| 212 | -c 在输出的代码中保留语句前的注释 | 212 | -e <字符串>, --execute <字符串> 执行文件或原始代码 |
| 213 | -w path 监测目录下的文件更改并重新编译生成目录下的文件 | 213 | -m, --minify 生成压缩(最小化)代码 |
| 214 | -v 打印版本号 | 214 | -r, --rewrite 重写输出以匹配原始代码行号 |
| 215 | -- 从标准输入读取原始代码,打印到编译结果到标准输出 | 215 | -t <目标路径>, --output-to <目标路径> |
| 216 | (必须是第一个且是唯一的参数) | 216 | 指定编译后文件的输出路径 |
| 217 | 217 | -o <文件>, --output <文件> 将输出写入文件 | |
| 218 | --target=version 指定编译器将生成的Lua代码版本号 | 218 | -p, --print 输出到标准输出 |
| 219 | (版本号只能是 5.1, 5.2, 5.3 或 5.4) | 219 | -b, --benchmark 输出编译耗时(不写入文件) |
| 220 | --path=path_str 将额外的Lua搜索路径字符串追加到package.path | 220 | -g, --globals 显示用到的全局变量及其所在的名称、行号、列号 |
| 221 | 221 | -s, --spaces 用空格代替制表符(tab)输出代码 | |
| 222 | 不添加任何选项执行命令可以进入REPL模式, | 222 | -l, --line-numbers 输出源代码的行号 |
| 223 | 在单行输入符号 '$' 并换行后,可以开始或是停止多行输入模式 | 223 | -j, --no-implicit-return 禁用文件末尾的隐式返回 |
| 224 | -c, --reserve-comments 保留源代码中的注释 | ||
| 225 | -w [<目录>], --watch [<目录>] | ||
| 226 | 监视目录变化并自动编译 | ||
| 227 | -v, --version 显示版本信息 | ||
| 228 | - 从标准输入读取,输出到标准输出(仅能作为唯一参数) | ||
| 229 | -- 等同于 '-',为兼容旧版本保留 | ||
| 230 | |||
| 231 | --target <版本> 指定生成代码的 Lua 版本 (只能为 5.1 ~ 5.5) | ||
| 232 | --path <路径字符串> 附加一个 Lua 搜索路径到 package.path | ||
| 233 | --<键>=<值> 以 key=value 形式传递编译器选项(保持已有用法) | ||
| 234 | |||
| 235 | 不带选项直接运行可进入交互模式(REPL),在交互模式里输入单独的符号 '$' | ||
| 236 | 可用于开始或结束多行模式。 | ||
| 224 | ``` | 237 | ``` |
| 225 |   使用案例: | 238 |   使用案例: |
| 226 |   递归编译当前路径下扩展名为 **.yue** 的每个月之脚本文件: **yue .** | 239 |   递归编译当前路径下扩展名为 **.yue** 的每个月之脚本文件: **yue .** |
