mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-20 16:15:59 +01:00
Commands documentation lack arguments when policy=user (#1514)
This commit is contained in:
parent
ae25fa994c
commit
a1e8d3c3dc
@ -403,13 +403,20 @@ generate_html_output(File, RegExp, Languages) ->
|
||||
Cmds3 = lists:sort(fun(#ejabberd_commands{name=N1}, #ejabberd_commands{name=N2}) ->
|
||||
N1 =< N2
|
||||
end, Cmds2),
|
||||
Cmds4 = [maybe_add_policy_arguments(Cmd) || Cmd <- Cmds3],
|
||||
Langs = binary:split(Languages, <<",">>, [global]),
|
||||
Out = lists:map(fun(C) -> gen_doc(C, true, Langs) end, Cmds3),
|
||||
Out = lists:map(fun(C) -> gen_doc(C, true, Langs) end, Cmds4),
|
||||
{ok, Fh} = file:open(File, [write]),
|
||||
io:format(Fh, "~s", [[html_pre(), Out, html_post()]]),
|
||||
file:close(Fh),
|
||||
ok.
|
||||
|
||||
maybe_add_policy_arguments(#ejabberd_commands{args=Args1, policy=user}=Cmd) ->
|
||||
Args2 = [{user, binary}, {server, binary} | Args1],
|
||||
Cmd#ejabberd_commands{args = Args2};
|
||||
maybe_add_policy_arguments(Cmd) ->
|
||||
Cmd.
|
||||
|
||||
generate_md_output(File, RegExp, Languages) ->
|
||||
Cmds = find_commands_definitions(),
|
||||
{ok, RE} = re:compile(RegExp),
|
||||
|
Loading…
Reference in New Issue
Block a user