Changeset

13640:c749a751b4a5

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.
author Kim Alvefur <zash@zash.se>
date Sun, 02 Feb 2025 13:33:17 +0100
parents 13639:94f77a1994dc
children 13641:d980c3e03637
files plugins/mod_admin_shell.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_admin_shell.lua	Sat Feb 01 20:42:59 2025 +0100
+++ b/plugins/mod_admin_shell.lua	Sun Feb 02 13:33:17 2025 +0100
@@ -456,7 +456,7 @@
 
 				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