diff options
author | Kim Alvefur <zash@zash.se> | 2021-06-12 18:06:13 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-06-12 18:06:13 +0200 |
commit | bd8d770411c9a50cd00caa9d9e11da2e06a55b7a (patch) | |
tree | e6f6c3aabb0abb642ebf2376db78f50d7894842c | |
parent | e17cfb0fdcdd00ada3026bf791572cd10444e5fe (diff) | |
download | prosody-bd8d770411c9a50cd00caa9d9e11da2e06a55b7a.tar.gz prosody-bd8d770411c9a50cd00caa9d9e11da2e06a55b7a.zip |
mod_admin_shell: module:info: Show friendlier name for known 'items'
-rw-r--r-- | plugins/mod_admin_shell.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua index ae83bd9c..faa29f2d 100644 --- a/plugins/mod_admin_shell.lua +++ b/plugins/mod_admin_shell.lua @@ -403,6 +403,13 @@ function def_env.module:info(name, hosts) return false, "mod_" .. name .. " does not appear to be loaded on the specified hosts"; end + local friendly_descriptions = { + ["adhoc-provider"] = "Ad-hoc commands", + ["auth-provider"] = "Authentication provider", + ["http-provider"] = "HTTP services", + ["net-provider"] = "Network service", + ["storage-provider"] = "Storage driver", + }; for host in hosts do local mod = modulemanager.get_module(host, name); if mod.module.host == "*" then @@ -417,7 +424,8 @@ function def_env.module:info(name, hosts) if mod.module.items and next(mod.module.items) ~= nil then print(" provides:"); for kind, items in pairs(mod.module.items) do - print(string.format(" - %s (%d item%s)", kind, #items, #items > 1 and "s" or "")); + local label = friendly_descriptions[kind] or kind:gsub("%-", " "):gsub("^%a", string.upper); + print(string.format(" - %s (%d item%s)", label, #items, #items > 1 and "s" or "")); end end if mod.module.dependencies and next(mod.module.dependencies) ~= nil then |