Comparison

util/prosodyctl.lua @ 10148:263b61d03d70

util.prosodyctl: Corrected indentation on my code
author João Duarte <jvsDuarte08@gmail.com>
date Sat, 20 Jul 2019 12:41:31 -0700
parent 10136:38775965fcd5
child 10152:7e9c30eab11e
comparison
equal deleted inserted replaced
10147:1a35b3a2b11b 10148:263b61d03d70
277 signal.kill(pid, signal.SIGHUP); 277 signal.kill(pid, signal.SIGHUP);
278 return true; 278 return true;
279 end 279 end
280 280
281 local function admin_operation(operation, arg) 281 local function admin_operation(operation, arg)
282 if arg[1] == "--help" then 282 if arg[1] == "--help" then
283 print(" admin-"..operation) 283 print(" admin-"..operation)
284 print(" "..operation.."plugins from a server (repository)") 284 print(" "..operation.."plugins from a server (repository)")
285 return 1; 285 return 1;
286 end 286 end
287 local modules, tree, server, refresh = "", "", "", "" 287 local modules, tree, server, refresh = "", "", "", ""
288 for i, _ in ipairs(arg) do 288 for i, _ in ipairs(arg) do
289 if arg[i]:sub(1, #"--tree=") == "--tree=" then 289 if arg[i]:sub(1, #"--tree=") == "--tree=" then
290 tree = arg[i].." " 290 tree = arg[i].." "
291 elseif arg[i]:sub(1, #"--server=") == "--server=" then 291 elseif arg[i]:sub(1, #"--server=") == "--server=" then
292 server = arg[i].." " 292 server = arg[i].." "
293 elseif arg[i]:sub(1, #"--no-refresh") == "--no-refresh" then 293 elseif arg[i]:sub(1, #"--no-refresh") == "--no-refresh" then
294 refresh = arg[i].." " 294 refresh = arg[i].." "
295 else 295 else
296 modules=modules..arg[i].." " 296 modules=modules..arg[i].." "
297 end 297 end
298 end 298 end
299 os.execute("luarocks-admin "..tree..operation..server..refresh..modules) 299 os.execute("luarocks-admin "..tree..operation..server..refresh..modules)
300 end 300 end
301 301
302 return { 302 return {
303 show_message = show_message; 303 show_message = show_message;
304 show_warning = show_message; 304 show_warning = show_message;