From 084774ae502a12466817b06bcfb713c91df13bc1 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 2 Feb 2025 13:33:17 +0100 Subject: 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. --- plugins/mod_admin_shell.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/mod_admin_shell.lua') 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 -- cgit v1.2.3