Comparison

prosodyctl @ 10169:25deff8b2db4

prosodyctl: Removed the local_plugins command
author João Duarte <jvsDuarte08@gmail.com>
date Wed, 24 Jul 2019 11:29:55 -0700
parent 10168:f365f814d641
child 10170:882ca2f965d5
comparison
equal deleted inserted replaced
10168:f365f814d641 10169:25deff8b2db4
156 return 1; 156 return 1;
157 end 157 end
158 for module in modulemanager.get_modules_for_host() do 158 for module in modulemanager.get_modules_for_host() do
159 show_warning("%s", module) 159 show_warning("%s", module)
160 end 160 end
161 end
162
163 function commands.local_plugins(arg)
164 if arg[1] == "--help" then
165 show_usage([[local_plugins]], [[Shows plugins currently available for prosody, locally]]);
166 return 1;
167 end
168 local directory = "./plugins"
169 local i, t, popen = 0, {}, io.popen
170 local pfile = popen('ls -a "'..directory..'"')
171 for filename in pfile:lines() do
172 if filename == "." or filename == ".." then
173 i = i + 1
174 else
175 i = i + 1
176 t[i] = filename
177 show_warning("%s", t[i])
178 end
179 end
180 pfile:close()
181 return 0;
182 end 161 end
183 162
184 function commands.adduser(arg) 163 function commands.adduser(arg)
185 if not arg[1] or arg[1] == "--help" then 164 if not arg[1] or arg[1] == "--help" then
186 show_usage([[adduser JID]], [[Create the specified user account in Prosody]]); 165 show_usage([[adduser JID]], [[Create the specified user account in Prosody]]);
1444 print("Usage: "..arg[0].." COMMAND [OPTIONS]"); 1423 print("Usage: "..arg[0].." COMMAND [OPTIONS]");
1445 print(""); 1424 print("");
1446 print("Where COMMAND may be one of:\n"); 1425 print("Where COMMAND may be one of:\n");
1447 1426
1448 local hidden_commands = require "util.set".new{ "register", "unregister", "addplugin" }; 1427 local hidden_commands = require "util.set".new{ "register", "unregister", "addplugin" };
1449 local commands_order = { "install", "remove", "list", "enabled_plugins", "local_plugins","adduser", "passwd", "deluser", "start", "stop", "restart", 1428 local commands_order = { "install", "remove", "list", "enabled_plugins", "adduser", "passwd", "deluser", "start", "stop", "restart", "reload",
1450 "reload", "about", "list" }; 1429 "about", "list" };
1451 1430
1452 local done = {}; 1431 local done = {};
1453 1432
1454 for _, command_name in ipairs(commands_order) do 1433 for _, command_name in ipairs(commands_order) do
1455 local command_func = commands[command_name]; 1434 local command_func = commands[command_name];