Software /
code /
prosody
Diff
prosodyctl @ 11005:cff243aafdce
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.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 10 Jul 2020 03:29:06 +0200 |
parent | 11004:d175de07dd73 |
child | 11006:8ac958938e0f |
line wrap: on
line diff
--- a/prosodyctl Fri Jul 10 03:29:02 2020 +0200 +++ b/prosodyctl Fri Jul 10 03:29:06 2020 +0200 @@ -457,7 +457,11 @@ 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