aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Duarte <jvsDuarte08@gmail.com>2019-06-21 01:16:18 +0100
committerJoão Duarte <jvsDuarte08@gmail.com>2019-06-21 01:16:18 +0100
commit4a60619f5d01c0306f4ddac8dcc6faf5aeb58e7d (patch)
tree5bac93051a49f7bf6d68488deb7e94138c273899
parentae48864f9d7368bf2030d391d68d6363278202ea (diff)
parent992d18aa62af23bbb5849e728a9b298b556e2cb0 (diff)
downloadprosody-4a60619f5d01c0306f4ddac8dcc6faf5aeb58e7d.tar.gz
prosody-4a60619f5d01c0306f4ddac8dcc6faf5aeb58e7d.zip
Merge my line of development->trunk
-rwxr-xr-xprosodyctl35
1 files changed, 35 insertions, 0 deletions
diff --git a/prosodyctl b/prosodyctl
index f5786ff9..d726c028 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -85,6 +85,41 @@ local prosodyctl_timeout = (configmanager.get("*", "prosodyctl_timeout") or 5) *
local commands = {};
local command = table.remove(arg, 1);
+function commands.list(arg)
+ -- Need to think about the case with many flags
+ local flag="--tree="
+ -- I'm considering the flag is the first, but there can be many flags
+ if arg[1] and arg[1]:sub(1, #flag) == flag then
+ local dir = arg[1]:match("=(.+)$")
+ -- These extra double brackets allow us to correctly process names with spaces
+ os.execute("luarocks list --tree=".."'"..dir.."'")
+ else
+ os.execute("luarocks list --tree="..prosody.paths.data.."/rocks")
+ end
+end
+
+function commands.enabled_plugins()
+ for module in modulemanager.get_modules_for_host() do
+ show_warning("%s", module)
+ end
+end
+
+function commands.local_plugins()
+ local directory = "./plugins"
+ local i, t, popen = 0, {}, io.popen
+ local pfile = popen('ls -a "'..directory..'"')
+ for filename in pfile:lines() do
+ if filename == "." or filename == ".." then
+ i = i + 1
+ else
+ i = i + 1
+ t[i] = filename
+ show_warning("%s", t[i])
+ end
+ end
+ pfile:close()
+end
+
function commands.adduser(arg)
if not arg[1] or arg[1] == "--help" then
show_usage([[adduser JID]], [[Create the specified user account in Prosody]]);