Get the arguments definition from the record (#3569)

This fixes "ejabberdctl help help"
This commit is contained in:
Badlop 2021-04-10 17:34:29 +02:00
parent 327dc31e62
commit f8a02f5d9d
1 changed files with 1 additions and 2 deletions

View File

@ -748,14 +748,13 @@ print_usage_command2(Cmd, C, MaxC, ShCode) ->
#ejabberd_commands{
tags = TagsAtoms,
desc = Desc,
args = ArgsDef,
longdesc = LongDesc,
result = ResultDef} = C,
NameFmt = [" ", ?B("Command Name"), ": ", Cmd, "\n"],
%% Initial indentation of result is 13 = length(" Arguments: ")
{ArgsDef, _, _} = ejabberd_commands:get_command_format(
C#ejabberd_commands.name, admin),
Args = [format_usage_ctype(ArgDef, 13) || ArgDef <- ArgsDef],
ArgsMargin = lists:duplicate(13, $\s),
ArgsListFmt = case Args of