Comparison

util/prosodyctl.lua @ 10189:d311168c71d1

util.prosodyctl: The check_flags function now considers that a module, if given, is specified at the penultimate argument it receives
author João Duarte <jvsDuarte08@gmail.com>
date Wed, 31 Jul 2019 11:08:43 -0700
parent 10187:85725e11c509
child 10191:395ce57dccdf
comparison
equal deleted inserted replaced
10188:dbd9880bf5c6 10189:d311168c71d1
299 local function check_flags(arg) 299 local function check_flags(arg)
300 local flag = "--tree="; 300 local flag = "--tree=";
301 -- There might not be any argument when the list command is calling this function 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 302 if arg[1] and arg[1]:sub(1, #flag) == flag then
303 local dir = arg[1]:match("=(.+)$") 303 local dir = arg[1]:match("=(.+)$")
304 return true, arg[2], dir; 304 return true, arg[#arg-1], dir;
305 end 305 end
306 return false, arg[1] 306 return false, arg[#arg-1];
307 end 307 end
308 308
309 local function call_luarocks(operation, mod, dir) 309 local function call_luarocks(operation, mod, dir)
310 if operation == "install" then 310 if operation == "install" then
311 show_message("Installing %s at %s", mod, dir); 311 show_message("Installing %s at %s", mod, dir);