Lua 解释器参数传递

usage: lua [options] [script [args]].
Available options are:
  -e stat  execute string 'stat' 直接在命令行输入代码
  -l name  require library 'name' 加载库文件
  -i       enter interactive mode after executing 'script' 交互模式(默认)
  -v       show version information
  --       stop handling options
  -        execute stdin and stop handling options


cmd命令行输入

用法:

E:\test\lua\test>lua -e print(100)
100

E:\test\lua\test>lua -e print(100) -i
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
100
>

退出lua交互模式 ctrl+c


参数传递:

Lua 解释器参数传递

Lua 解释器参数传递