mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
ejabberd_ctl: Support policy=user in the help and return proper arguments
This commit is contained in:
parent
8d39431d68
commit
245c9ae446
@ -835,6 +835,11 @@ filter_commands_regexp(All, Glob) ->
|
|||||||
end,
|
end,
|
||||||
All).
|
All).
|
||||||
|
|
||||||
|
maybe_add_policy_arguments(Args, user) ->
|
||||||
|
[{user, binary}, {host, binary} | Args];
|
||||||
|
maybe_add_policy_arguments(Args, _) ->
|
||||||
|
Args.
|
||||||
|
|
||||||
-spec print_usage_command(Cmd::string(), MaxC::integer(),
|
-spec print_usage_command(Cmd::string(), MaxC::integer(),
|
||||||
ShCode::boolean(), Version::integer()) -> ok.
|
ShCode::boolean(), Version::integer()) -> ok.
|
||||||
print_usage_command(Cmd, MaxC, ShCode, Version) ->
|
print_usage_command(Cmd, MaxC, ShCode, Version) ->
|
||||||
@ -847,13 +852,15 @@ print_usage_command2(Cmd, C, MaxC, ShCode) ->
|
|||||||
tags = TagsAtoms,
|
tags = TagsAtoms,
|
||||||
definer = Definer,
|
definer = Definer,
|
||||||
desc = Desc,
|
desc = Desc,
|
||||||
args = ArgsDef,
|
args = ArgsDefPreliminary,
|
||||||
|
policy = Policy,
|
||||||
longdesc = LongDesc,
|
longdesc = LongDesc,
|
||||||
result = ResultDef} = C,
|
result = ResultDef} = C,
|
||||||
|
|
||||||
NameFmt = [" ", ?B("Command Name"), ": ", ?C(Cmd), "\n"],
|
NameFmt = [" ", ?B("Command Name"), ": ", ?C(Cmd), "\n"],
|
||||||
|
|
||||||
%% Initial indentation of result is 13 = length(" Arguments: ")
|
%% Initial indentation of result is 13 = length(" Arguments: ")
|
||||||
|
ArgsDef = maybe_add_policy_arguments(ArgsDefPreliminary, Policy),
|
||||||
Args = [format_usage_ctype(ArgDef, 13) || ArgDef <- ArgsDef],
|
Args = [format_usage_ctype(ArgDef, 13) || ArgDef <- ArgsDef],
|
||||||
ArgsMargin = lists:duplicate(13, $\s),
|
ArgsMargin = lists:duplicate(13, $\s),
|
||||||
ArgsListFmt = case Args of
|
ArgsListFmt = case Args of
|
||||||
|
Loading…
Reference in New Issue
Block a user