Software /
code /
prosody
Changeset
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 |
parents | 11004:d175de07dd73 |
children | 11006:8ac958938e0f |
files | prosodyctl |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
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