aboutsummaryrefslogtreecommitdiffstats
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
commit947c136c95d5767f83127ee62c30f13f14aea615 (patch)
tree564d7391cd868e46f18c806ac5823b193dd4f675
parentc80ef421128f58dcfdce656c90a7d9daa918ae39 (diff)
downloadprosody-947c136c95d5767f83127ee62c30f13f14aea615.tar.gz
prosody-947c136c95d5767f83127ee62c30f13f14aea615.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.
-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