aboutsummaryrefslogtreecommitdiffstats
path: root/util/prosodyctl.lua
diff options
context:
space:
mode:
authorJo?o Duarte <jvsDuarte08@gmail.com>2019-07-31 06:42:13 -0700
committerJo?o Duarte <jvsDuarte08@gmail.com>2019-07-31 06:42:13 -0700
commitebb62190fb2ec32435be0074f84532d248f463f3 (patch)
tree67667661b4ae33dd507ef720338ad176d8096265 /util/prosodyctl.lua
parent457ca610cc9f40a1535ee97a1351713664d27660 (diff)
downloadprosody-ebb62190fb2ec32435be0074f84532d248f463f3.tar.gz
prosody-ebb62190fb2ec32435be0074f84532d248f463f3.zip
util.prosodyctl: Added the check_flags function
Diffstat (limited to 'util/prosodyctl.lua')
-rw-r--r--util/prosodyctl.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/util/prosodyctl.lua b/util/prosodyctl.lua
index fbeb9540..affa2f6b 100644
--- a/util/prosodyctl.lua
+++ b/util/prosodyctl.lua
@@ -292,10 +292,20 @@ local function get_path_custom_plugins(plugin_paths)
-- I'm considering that we are using just one path to custom plugins, and it is the first in prosody.paths.plugins, for now
-- luacheck: ignore 512
for path in plugin_paths:gmatch("[^;]+") do
- return path
+ return path;
end
end
+local function check_flags(arg)
+ local flag = "--tree=";
+ -- There might not be any argument when the list command is calling this function
+ if arg[1] and arg[1]:sub(1, #flag) == flag then
+ local dir = arg[1]:match("=(.+)$")
+ return true, arg[2], dir;
+ end
+ return false, arg[1]
+end
+
return {
show_message = show_message;
show_warning = show_message;
@@ -317,4 +327,5 @@ return {
stop = stop;
reload = reload;
get_path_custom_plugins = get_path_custom_plugins;
+ check_flags = check_flags;
};