Skip to content

Commit

Permalink
Update help.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
SignalManSteve authored Jun 27, 2024
1 parent 46ba88b commit cc9f157
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions Cmdr/BuiltInCommands/help.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -36,22 +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
if type(arg) == "function" then
arg = arg(context)
end

context:Reply(
`{arg.Name}{if arg.Optional == true then "?" else ""}: {arg.Type} - {arg.Description}`
)
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)
Expand All @@ -63,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
Expand Down

0 comments on commit cc9f157

Please sign in to comment.