25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Mix the commands update_all/0 and update_module/1 into update/1 (EJAB-1237)

This commit is contained in:
Badlop 2010-05-25 20:01:04 +02:00
parent 75c5803431
commit 72b2209c3e

View File

@ -32,7 +32,7 @@
status/0, reopen_log/0,
stop_kindly/2, send_service_message_all_mucs/2,
%% Erlang
update_list/0, update_all/0, update_module/1,
update_list/0, update/1,
%% Accounts
register/3, unregister/2,
registered_users/1,
@ -102,14 +102,9 @@ commands() ->
module = ?MODULE, function = update_list_modified,
args = [],
result = {modules, {list, {module, string}}}},
#ejabberd_commands{name = update_all, tags = [server],
desc = "Update all the modified modules",
module = ?MODULE, function = update_all,
args = [],
result = {res, rescode}},
#ejabberd_commands{name = update_module, tags = [server],
desc = "Update the given module",
module = ?MODULE, function = update_module,
#ejabberd_commands{name = update, tags = [server],
desc = "Update the given module, or use the keyword: all",
module = ?MODULE, function = update,
args = [{module, string}],
result = {res, rescode}},
@ -299,8 +294,10 @@ update_list() ->
ejabberd_update:update_info(),
[atom_to_list(Beam) || Beam <- UpdatedBeams].
update_all() ->
[update_module(ModStr) || ModStr <- update_list()].
update("all") ->
[update_module(ModStr) || ModStr <- update_list()];
update(ModStr) ->
update_module(ModStr).
update_module(ModuleNameString) ->
ModuleName = list_to_atom(ModuleNameString),