aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_admin_shell.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2025-02-02 13:33:17 +0100
committerKim Alvefur <zash@zash.se>2025-02-02 13:33:17 +0100
commit084774ae502a12466817b06bcfb713c91df13bc1 (patch)
tree0ab761fc84b8a41677c3c657376a9c4acb3b8044 /plugins/mod_admin_shell.lua
parent885164b2b1103af1fd794896037ff65d17ea3bc0 (diff)
downloadprosody-084774ae502a12466817b06bcfb713c91df13bc1.tar.gz
prosody-084774ae502a12466817b06bcfb713c91df13bc1.zip
mod_admin_shell: Fix help forgetting arguments
The array:pluck() method mutates the args, replacing the table items with the resulting strings. On later runs I assume it tries to index the string, which returns nil, emptying the array.
Diffstat (limited to 'plugins/mod_admin_shell.lua')
-rw-r--r--plugins/mod_admin_shell.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua
index 974ed8d9..d1ccf9f1 100644
--- a/plugins/mod_admin_shell.lua
+++ b/plugins/mod_admin_shell.lua
@@ -456,7 +456,7 @@ def_env.help = setmetatable({}, {
for command, command_help in it.sorted_pairs(section_help.commands or {}) do
c = c + 1;
- local args = command_help.args:pluck("name"):concat(", ");
+ local args = array.pluck(command_help.args, "name"):concat(", ");
local desc = command_help.desc or command_help.module and ("Provided by mod_"..command_help.module) or "";
print(("%s:%s(%s) - %s"):format(section_name, command, args, desc));
end