lus

CLI

Contents (4)
  1. lus
    1. Options
  2. lus format
  3. lusc

lus#

lus [command] [options] [script [args]]

Two commands exist; run is implied when none is given.

CommandPurpose
runRun a Lus script (default).
formatFormat Lus source files.

Options#

OptionEffect
-e statExecute the string stat.
-iEnter interactive mode after executing script.
-l modRequire library mod into global mod.
-l g=modRequire library mod into global g.
-vShow version information.
-EIgnore environment variables.
-WTurn warnings on.
-WpedanticTurn on pedantic warnings, which flag superseded Lua idioms.
-P permGrant a permission (e.g. -Pfs:read, -Pnetwork).
--pledge permSame as -P.
--ast-graph fileDump the AST to a .dot file (does not run the script).
--ast-json fileDump the AST to a JSON file (does not run the script).
--standalone fileCreate a standalone executable from the script.
--include path[:alias]Include a file or directory in the standalone bundle.
--no-fastcallDisable fastcall optimizations.
--readonly-envFreeze _ENV after init (enables fast dispatch).
--gc-pause NGC pause: the heap may grow to N% of its live size before a new collection cycle (default 250; lower trades CPU for lower peak memory).
--strip-debugDrop debug info (line numbers, local/upvalue names, source) from loaded code to save memory; tracebacks and the debug library lose detail.
--Stop handling options.
-Stop handling options and execute stdin.

lus format#

lus format [options] [file ...]

With no --write or --check, formatted output is printed to stdout.

OptionEffect
--checkCheck if files are formatted (exit 1 if not).
--writeFormat files in-place.
--stdinRead from stdin, write to stdout.
--indent NSet indent width (default: 4).
--helpShow help.

lusc#

The bytecode compiler ships as its own binary. It compiles .lus sources to bytecode loadable by the interpreter and liblus.

lusc [options] [filenames]
OptionEffect
-fEmit fastcall opcodes.
-lList bytecode (use -l -l for a full listing).
-o nameOutput to file name (default luac.out).
-pParse only.
-sStrip debug information.
-vShow version information.
--no-fastcallDisable fastcall opcodes (overrides -f).
--Stop handling options.
-Stop handling options and process stdin.

Building the binaries themselves is covered in Compiling Lus.