LuaImg is a commandline interpreter that can execute snippets, files, or be an interactive console. To execute simple snippets from the shell, run luaimg as follows:
To execute a script file, use the -f option:
The interpreter can execute multiple snippets and files, they are executed in the order they appear along the comandline. Any additional commandline parameters (ones that do not begin with a -) are available in the script as Lua varags (...). The -- parameter causes all subsequent commandline options to be treated as script arguments, as is standard in many unix shell executables.
The -i parameter enters an interactive shell where LuaImg script fragments can be typed. This is extremely useful for debugging and rapid prototyping, and can be combined with the other parameters.
Finally, the -F parameter is a shorthand for -f --, and allows using a hashbang first line annotation for unix scripts. These scripts can then have execute permissions and be run as regular unix executables (with their own commandline parameters:
See the examples directory in the repository for examples of non-trivial programs. In particular the logo (seen on this web site) is generated with the logo.lua script in this directory.