Mercurial > prosody-hg
diff plugins/mod_admin_shell.lua @ 14127:d666e7cd8609 13.0
mod_admin_shell: Show help listing when specifying only a section name
This is significantly better than showing 'table:0x.....'.
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 16 Apr 2026 18:16:05 +0100 |
| parents | 0e9e3efa381f |
| children | c1469296190d 2a050069f37b |
line wrap: on
line diff
--- a/plugins/mod_admin_shell.lua Thu Apr 16 16:12:34 2026 +0100 +++ b/plugins/mod_admin_shell.lua Thu Apr 16 18:16:05 2026 +0100 @@ -415,6 +415,10 @@ end end + if (source or line):match("^%w+$") and def_env[source or line] then + source, line = nil, "help:"..(source or line).."();"; + end + local chunkname = "=console"; -- luacheck: ignore 311/err local chunk, err = envload(source or ("return "..line), chunkname, env);
