Comparison

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
comparison
equal deleted inserted replaced
11004:d175de07dd73 11005:cff243aafdce
455 and name ~= "_G" and not name:match("%.") then 455 and name ~= "_G" and not name:match("%.") then
456 name = friendly_names[name] or name; 456 name = friendly_names[name] or name;
457 if #name > longest_name then 457 if #name > longest_name then
458 longest_name = #name; 458 longest_name = #name;
459 end 459 end
460 module_versions[name] = module._VERSION; 460 local mod_version = module._VERSION;
461 if tostring(mod_version):sub(1, #name+1) == name .. " " then
462 mod_version = mod_version:sub(#name+2);
463 end
464 module_versions[name] = mod_version;
461 end 465 end
462 end 466 end
463 if lunbound then 467 if lunbound then
464 if not module_versions["lunbound"] then 468 if not module_versions["lunbound"] then
465 module_versions["lunbound"] = "<= 0.5"; 469 module_versions["lunbound"] = "<= 0.5";