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
commitc9db4cec24bbf5f010fbb8242efe1d714770fe16 (patch)
tree5bac93051a49f7bf6d68488deb7e94138c273899
parent37fc8f2a2fdaac95d7aee6e51b88514f3febef31 (diff)
parentc91bee45450498e9858b10b1f1ecdeabe4fc8d92 (diff)
downloadprosody-c9db4cec24bbf5f010fbb8242efe1d714770fe16.tar.gz
prosody-c9db4cec24bbf5f010fbb8242efe1d714770fe16.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]]);