summaryrefslogtreecommitdiff
path: root/src/ejabberd_commands.erl
diff options
context:
space:
mode:
authorPaweł Chmielowski <pchmielowski@process-one.net>2016-01-26 10:00:11 +0100
committerPaweł Chmielowski <pchmielowski@process-one.net>2016-01-26 10:00:28 +0100
commitbdeb4a7e32dbf6b998018196781cdd142bff3c38 (patch)
tree23c1d74bfa8bf2667f0fdd2ad1ef0d9578a4257f /src/ejabberd_commands.erl
parentMerge branch 'master' of github.com:processone/ejabberd (diff)
Add a way to get all ejabberd_commands, not only those that was registered
This is part of (TECH-1828).
Diffstat (limited to 'src/ejabberd_commands.erl')
-rw-r--r--src/ejabberd_commands.erl15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/ejabberd_commands.erl b/src/ejabberd_commands.erl
index 547da028..265d7141 100644
--- a/src/ejabberd_commands.erl
+++ b/src/ejabberd_commands.erl
@@ -219,7 +219,8 @@
unregister_commands/1,
execute_command/2,
execute_command/4,
- opt_type/1
+ opt_type/1,
+ get_commands_spec/0
]).
-include("ejabberd_commands.hrl").
@@ -228,10 +229,8 @@
-define(POLICY_ACCESS, '$policy').
-init() ->
- ets:new(ejabberd_commands, [named_table, set, public,
- {keypos, #ejabberd_commands.name}]),
- register_commands([
+get_commands_spec() ->
+ [
#ejabberd_commands{name = gen_html_doc_for_commands, tags = [documentation],
desc = "Generates html documentation for ejabberd_commands",
module = ejabberd_commands_doc, function = generate_html_output,
@@ -259,7 +258,11 @@ init() ->
"that will have example invocation include in markdown document"],
result_desc = "0 if command failed, 1 when succedded",
args_example = ["/home/me/docs/api.html", "mod_admin", "java,json"],
- result_example = ok}]).
+ result_example = ok}].
+init() ->
+ ets:new(ejabberd_commands, [named_table, set, public,
+ {keypos, #ejabberd_commands.name}]),
+ register_commands(get_commands_spec()).
-spec register_commands([ejabberd_commands()]) -> ok.