# HG changeset patch # User João Duarte # Date 1565992917 25200 # Node ID 219a4958673da25e714f056e7c206c76d63791e4 # Parent 4c755c2e630520791815b023fa446245c9763a89 util/prosodyctl: Removed the check_flags and execute_command function diff -r 4c755c2e6305 -r 219a4958673d util/prosodyctl.lua --- a/util/prosodyctl.lua Fri Aug 16 14:58:29 2019 -0700 +++ b/util/prosodyctl.lua Fri Aug 16 15:01:57 2019 -0700 @@ -296,16 +296,6 @@ 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[#arg-1], dir; - end - return false, arg[#arg-1]; -end - local function call_luarocks(operation, mod, dir) if operation == "install" then show_message("Installing %s at %s", mod, dir); @@ -322,19 +312,6 @@ end end -local function execute_command(arg) - local operation = arg[#arg] - local tree, mod, dir = check_flags(arg); - if tree then - call_luarocks(operation, mod, dir); - return 0; - else - dir = get_path_custom_plugins(prosody.paths.plugins); - call_luarocks(operation, mod, dir); - return 0; - end -end - return { show_message = show_message; show_warning = show_message; @@ -356,7 +333,5 @@ stop = stop; reload = reload; get_path_custom_plugins = get_path_custom_plugins; - check_flags = check_flags; call_luarocks = call_luarocks; - execute_command = execute_command; };