aboutsummaryrefslogtreecommitdiffstats
path: root/prosodyctl
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-07-10 03:29:06 +0200
committerKim Alvefur <zash@zash.se>2020-07-10 03:29:06 +0200
commitf96ca297e3c83226a56b09337cc37528a2320c8a (patch)
tree564d7391cd868e46f18c806ac5823b193dd4f675 /prosodyctl
parenta4914feb84f2a13c0884f9e3f89cf8e636d87980 (diff)
downloadprosody-f96ca297e3c83226a56b09337cc37528a2320c8a.tar.gz
prosody-f96ca297e3c83226a56b09337cc37528a2320c8a.zip
prosodyctl about: Strip name from lua module _VERSION
Some modules have _VERSION = "LuaModule x.y.z", so it is a bit weird to show the name twice.
Diffstat (limited to 'prosodyctl')
-rwxr-xr-xprosodyctl6
1 files changed, 5 insertions, 1 deletions
diff --git a/prosodyctl b/prosodyctl
index 27a44ec4..fabfe04f 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -457,7 +457,11 @@ function commands.about(arg)
if #name > longest_name then
longest_name = #name;
end
- module_versions[name] = module._VERSION;
+ local mod_version = module._VERSION;
+ if tostring(mod_version):sub(1, #name+1) == name .. " " then
+ mod_version = mod_version:sub(#name+2);
+ end
+ module_versions[name] = mod_version;
end
end
if lunbound then