Skip to content

A Lua script that prints all Lua globals being declared (written) or accessed (read) by a supplied Lua script.

License

Notifications You must be signed in to change notification settings

Warhammer-Mods/lua-globals

Repository files navigation

Lua Globals

Prints all Lua globals being declared (written) or accessed (read) by a supplied lua script.

Installation

With Luarocks installed, run

luarocks install lua-globals

Otherwise, download lua-globals.lua, and its dependency, argparse, and place them into the directory for Lua libraries or your working directory so that you can call lua-globals from shell.

Additionally, do the same for inspect if you plan to use the -d | --debug flag.

Usage

lua-globals -m RW your_script.lua

lua-globals [-h] [-l {51,52,53,54}] [-m {R,W,RW}] [-d] ([<input>] ... | [-i])

Arguments

  • input
    Input file. If no provided, reads from STDIN

Options

  • -h, --help
    Show help message and exit.
  • -i, --read-from-stdin
    Read from stdin.
  • -l {51,52,53,54},
    --lua-version {51,52,53,54}
    Script Lua version target (default: 54)
  • -m {R,W,RW},
    --mode {R,W,RW}
    Globals reporting mode.
    R is for read access, W is for write access, RW if for all globals access. (default: RW)
  • -d,
    --debug
    Enables debug output.

Credits

This is a fork of Egor Scriptunoff's amazing show_globals GitHub Gist organized as a repo and published to Luarocks package manager with extended cli support, thus all the credit goes to Egor Scriptunoff.

About

A Lua script that prints all Lua globals being declared (written) or accessed (read) by a supplied Lua script.

Topics

Resources

License

Stars

Watchers

Forks

Languages