Comparison

util/prosodyctl.lua @ 10180:152604d54732

util.prosodyctl: Added the check_flags function
author João Duarte <jvsDuarte08@gmail.com>
date Wed, 31 Jul 2019 06:42:13 -0700
parent 10167:f343ed1f02fd
child 10181:c7d5cd766533
comparison
equal deleted inserted replaced
10179:2364e9533d0e 10180:152604d54732
290 290
291 local function get_path_custom_plugins(plugin_paths) 291 local function get_path_custom_plugins(plugin_paths)
292 -- I'm considering that we are using just one path to custom plugins, and it is the first in prosody.paths.plugins, for now 292 -- I'm considering that we are using just one path to custom plugins, and it is the first in prosody.paths.plugins, for now
293 -- luacheck: ignore 512 293 -- luacheck: ignore 512
294 for path in plugin_paths:gmatch("[^;]+") do 294 for path in plugin_paths:gmatch("[^;]+") do
295 return path 295 return path;
296 end 296 end
297 end
298
299 local function check_flags(arg)
300 local flag = "--tree=";
301 -- There might not be any argument when the list command is calling this function
302 if arg[1] and arg[1]:sub(1, #flag) == flag then
303 local dir = arg[1]:match("=(.+)$")
304 return true, arg[2], dir;
305 end
306 return false, arg[1]
297 end 307 end
298 308
299 return { 309 return {
300 show_message = show_message; 310 show_message = show_message;
301 show_warning = show_message; 311 show_warning = show_message;
315 isrunning = isrunning; 325 isrunning = isrunning;
316 start = start; 326 start = start;
317 stop = stop; 327 stop = stop;
318 reload = reload; 328 reload = reload;
319 get_path_custom_plugins = get_path_custom_plugins; 329 get_path_custom_plugins = get_path_custom_plugins;
330 check_flags = check_flags;
320 }; 331 };