prosodyctl: Changed the command 'admin_add' to 'admin_operation', which will be called by both add/remove operations
authorJoão Duarte <jvsDuarte08@gmail.com>
Tue, 25 Jun 2019 00:52:12 +0100
changeset 10133 406afedc9375
parent 10132 026815f8d832
child 10134 667f37603308
prosodyctl: Changed the command 'admin_add' to 'admin_operation', which will be called by both add/remove operations
prosodyctl
--- a/prosodyctl	Fri Jun 21 19:03:04 2019 +0100
+++ b/prosodyctl	Tue Jun 25 00:52:12 2019 +0100
@@ -98,7 +98,7 @@
   end
 end
 
-function commands.admin_add(arg)
+function admin_operation(operation, arg)
   local modules, tree, server, refresh = "", "", "", ""
   for i, _ in ipairs(arg) do
     if arg[i]:sub(1, #"--tree=") == "--tree=" then
@@ -111,7 +111,7 @@
       modules=modules..arg[i].." "
     end
   end
-  os.execute("luarocks-admin "..tree.."add "..server..refresh..modules)
+  os.execute("luarocks-admin "..tree..operation..server..refresh..modules)
 end
 
 function commands.enabled_plugins()