LIKWID-LUA(1)

πŸ’– LIKWID-LUA(1) β€” the likwid-lua girlies' guide πŸ’–

okay bestie, so this is likwid-lua, aka the Lua interpreter πŸ’… it's from the LIKWID-LUA(1) section of the General Commands Manual, and it's literally your girl for running Lua. let's get into it πŸ¦‹


✨ SYNOPSIS ✨

likwid-lua [ options ] [ script [ args ] ]

like. that's the whole vibe. options, then optionally a script, then optionally some args for that script. simple, iconic, no notes πŸ’–


🌸 DESCRIPTION 🌸

likwid-lua is the standalone Lua interpreter, bestie!! what does that mean? it means it loads and executes Lua programs for you β€” either as textual source form or as precompiled binary form. (and btw, those precompiled binaries? they're output by luac, the Lua compiler. just so you know who made them πŸ‘‘)

and the range on this thing?? likwid-lua can be used as a batch interpreter AND interactively β€” she contains multitudes fr fr 😭

here's how the whole flow goes:

  • the given options are handled in order πŸ“‹
  • and then the Lua program in file script is loaded and executed πŸŽ€
  • the given args? they're available to script as strings in a global table named arg 🫢

and if you give her literally no options and no arguments? then:

-v -i is assumed when the standard input is a terminal; otherwise, - is assumed. πŸ’€

yes bestie, she has defaults. she's proactive. main character energy tbh ✨

πŸŽ€ interactive mode πŸŽ€

when she's in interactive mode, likwid-lua:

  1. prompts you πŸ’¬
  2. reads lines from the standard input πŸ“₯
  3. executes them as they are read ⚑

and if the line contains an expression or list of expressions, then the line is evaluated and the results are printed. if a line does not contain a complete statement, then a secondary prompt is displayed and lines are read until a complete statement is formed or a syntax error is found πŸ™ˆ

🧚 the very start (yes, before EVERYTHING) 🧚

at the very start, before even handling the command line, likwid-lua checks the contents of the environment variables LUA_INIT_5_3 or LUA_INIT, in that order. and then:

  • if the contents is of the form '@filename', then filename is executed πŸ“œ
  • otherwise, the string is assumed to be a Lua statement and is executed ⚑

she's checking her env vars before she even looks at you. queen behavior πŸ‘‘


πŸ’… OPTIONS πŸ’…

one bullet per option bestie, and yes we're doing all of them, we don't skip πŸ’–

  • -e stat β€” execute statement stat. just. run it. right there. πŸ”₯
  • -i β€” enter interactive mode after executing script. so she runs your thing and then sticks around to chat 🫢
  • -l name β€” execute the equivalent of name=require('name') before executing script. preloading, but make it cute ✨
  • -v β€” show version information. say hi to the version πŸ‘‹
  • -E β€” ignore environment variables. (yes, even the LUA_INIT_5_3 and LUA_INIT ones from up there. she's choosing peace 🌸)
  • -- β€” stop handling options. that's it, that's the whole job πŸ’€
  • - β€” stop handling options and execute the standard input as a file. stdin but make it a file πŸŽ€

πŸ¦‹ SEE ALSO πŸ¦‹

the documentation at lua.org, especially section 7 of the reference manual. go read it, it's giving educational πŸ’œ


😭 DIAGNOSTICS 😭

error messages should be self explanatory. like, she'll tell you. she's not gonna make you guess. communication queen 🫢


πŸ‘‘ AUTHORS πŸ‘‘

R. Ierusalimschy, L. H. de Figueiredo, W. Celes</purl> β€” the literal legends who made this happen 🌈


okay and for the cute sign-off: this little page lives in the General Commands Manual under LIKWID-LUA(1), and its footer date is $Date: 2014/12/10 15:55:45 $ πŸ’– so yeah, that's the timestamp, that's the lore, go run some Lua bestie πŸ¦‹βœ¨πŸŽ€