mirror of
https://github.com/chubin/cheat.sheets
synced 2024-11-17 09:25:32 +00:00
30 lines
999 B
Plaintext
30 lines
999 B
Plaintext
# lua
|
|
# Simple, extensible, embeddable programming language
|
|
|
|
# You may not have access to the `lua` command, but instead to something like
|
|
# `lua5.3` or one of a different version. The following information assumes you
|
|
# have the `lua` command, as-is, but alternative commands may also work the
|
|
# same or similarly, version allowing.
|
|
|
|
# Start an interactive Lua shell:
|
|
lua
|
|
|
|
# Execute a Lua script.
|
|
lua script_name.lua
|
|
# Execute a Lua script, with arguments (IE: flags) given to the script itself.
|
|
lua script_name.lua [ARGS]
|
|
|
|
# Execute a Lua expression(s), as though executed from within a script.
|
|
lua -e 'print("Hello World")'
|
|
|
|
# All options are handled in order, except `-i`. For instance, an invocation
|
|
# like first set a to 1, then print the value of a (1), and finally run the
|
|
# file `script.lua`
|
|
lua -e'a=1' -e 'print(a)' script.lua
|
|
|
|
# See also:
|
|
# Lua language cheat sheets at /lua/
|
|
# list of pages: /lua/:list
|
|
# learn lua: /lua/:learn
|
|
# search in pages: /lua/~keyword
|