diff --git a/Makefile b/Makefile index 7d48349..c097333 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,6 @@ fmt: shfmt --language-dialect bash --indent 2 --write bin/* lint: - shellcheck --shell bash --external-sources bin/* + shellcheck --shell bash bin/* lib/* .PHONY: precommit test test_luajit lint diff --git a/bin/help.config b/bin/help.config new file mode 100755 index 0000000..2a3524a --- /dev/null +++ b/bin/help.config @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +set -euo pipefail +IFS=$'\t\n' + +version="${ASDF_INSTALL_VERSION:-}" + +cat <<'EOF' +Environment Variables: + + ASDF_LUA_LUAROCKS_VERSION + Specify the LuaRocks version to install (Lua 5.x only, not LuaJIT). + If not set, the latest version of LuaRocks will be installed. + Example: export ASDF_LUA_LUAROCKS_VERSION=3.9.2 +EOF + +if [ -n "$version" ]; then + if [[ ! "$version" == LuaJIT-* ]]; then + IFS='.' read -ra version_array <<<"$version" + major_minor="${version_array[0]}${version_array[1]}" + + if [ "$major_minor" = "54" ]; then + cat <<'EOF' + + ASDF_LUA_LINUX_READLINE + Enable readline support for Lua 5.4.x on Linux. + Readline is optional for Lua 5.4 and disabled by default. + Set to 1 to enable: export ASDF_LUA_LINUX_READLINE=1 +EOF + fi + fi +else + cat <<'EOF' + + ASDF_LUA_LINUX_READLINE + Enable readline support for Lua 5.4.x on Linux. + Readline is optional for Lua 5.4 and disabled by default. + Set to 1 to enable: export ASDF_LUA_LINUX_READLINE=1 + +Readline Support by Version: + - Lua 5.1 - 5.3: Readline is required (build fails without libreadline-dev) + - Lua 5.4: Readline is optional and disabled by default + - Lua 5.5+: Readline is loaded dynamically at runtime if available + - LuaJIT: Does not use readline +EOF +fi diff --git a/bin/help.deps b/bin/help.deps new file mode 100755 index 0000000..1929f68 --- /dev/null +++ b/bin/help.deps @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +set -euo pipefail +IFS=$'\t\n' + +os="$(uname -s)" + +if [ "$os" = "Darwin" ]; then + cat </dev/null 2>&1; then + cat </dev/null 2>&1; then + cat <