aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-03-27 14:05:56 +0200
committerKim Alvefur <zash@zash.se>2022-03-27 14:05:56 +0200
commitc50c315705e1c11070bd7210ecbdd3e395d59ad4 (patch)
treec56d4be23678403bd216a181242ad29e8d0f4466
parentcbcb57fa24650c6ac001c4c1c9ab39a61b6266eb (diff)
downloadprosody-c50c315705e1c11070bd7210ecbdd3e395d59ad4.tar.gz
prosody-c50c315705e1c11070bd7210ecbdd3e395d59ad4.zip
prosodyctl about: Report version of lua-readline
Good to know since it affects how well the shell works
-rwxr-xr-xprosodyctl10
1 files changed, 8 insertions, 2 deletions
diff --git a/prosodyctl b/prosodyctl
index 2d1f5195..2318cf05 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -484,6 +484,7 @@ function commands.about(arg)
local library_versions = {};
dependencies.softreq"ssl";
dependencies.softreq"DBI";
+ dependencies.softreq"readline";
local friendly_names = {
DBI = "LuaDBI";
lfs = "LuaFileSystem";
@@ -492,17 +493,22 @@ function commands.about(arg)
socket = "LuaSocket";
ssl = "LuaSec";
};
+ local alternate_version_fields = {
+ -- These diverge from the module._VERSION convention
+ readline = "Version";
+ }
local lunbound = dependencies.softreq"lunbound";
local lxp = dependencies.softreq"lxp";
local hashes = dependencies.softreq"util.hashes";
for name, module in pairs(package.loaded) do
- if type(module) == "table" and rawget(module, "_VERSION")
+ local version_field = alternate_version_fields[name] or "_VERSION";
+ if type(module) == "table" and rawget(module, version_field)
and name ~= "_G" and not name:match("%.") then
name = friendly_names[name] or name;
if #name > longest_name then
longest_name = #name;
end
- local mod_version = module._VERSION;
+ local mod_version = module[version_field];
if tostring(mod_version):sub(1, #name+1) == name .. " " then
mod_version = mod_version:sub(#name+2);
end