diff --git a/Cmdr/BuiltInCommands/help.lua b/Cmdr/BuiltInCommands/help.lua index 6fc4c0c4..1193c434 100644 --- a/Cmdr/BuiltInCommands/help.lua +++ b/Cmdr/BuiltInCommands/help.lua @@ -17,7 +17,6 @@ Tips return { Name = "help", - Aliases = { "cmds", "commands" }, Description = "Displays a list of all commands, or inspects one command.", Group = "Help", Args = { @@ -36,20 +35,17 @@ return { if command.Aliases and #command.Aliases > 0 then context:Reply(`Aliases: {table.concat(command.Aliases, ", ")}`, Color3.fromRGB(230, 230, 230)) end - if command.Description then - context:Reply(`Description: {command.Description}`, Color3.fromRGB(230, 230, 230)) - end - if command.Group then - context:Reply(`Group: {command.Group}`, Color3.fromRGB(230, 230, 230)) - end - if command.Args then - for i, arg in ipairs(command.Args) do - context:Reply( - `#{i} {if type(arg) == "table" - then `{arg.Name}{if arg.Optional == true then "?" else ""}: {arg.Type} - {arg.Description}` - else "Unknown (inline argument)"}` - ) + context:Reply(command.Description, Color3.fromRGB(230, 230, 230)) + for i, arg in ipairs(command.Args) do + if type(arg) == "function" then + arg = arg(arg) end + + context:Reply( + `{arg.Name}{if arg.Optional then "?" else ""}: {if type(arg.Type) == "string" + then arg.Type + else arg.Type.DisplayName} - {arg.Description}` + ) end else context:Reply(ARGUMENT_SHORTHANDS) @@ -61,10 +57,10 @@ return { end) local lastGroup for _, command in ipairs(commands) do - local group = command.Group or "No Group" - if lastGroup ~= group then - context:Reply(`\n{group}\n{string.rep("-", #group)}`) - lastGroup = group + command.Group = command.Group or "No Group" + if lastGroup ~= command.Group then + context:Reply(`\n{command.Group}\n{string.rep("-", #command.Group)}`) + lastGroup = command.Group end context:Reply(if command.Description then `{command.Name} - {command.Description}` else command.Name) end