Comparison

prosodyctl @ 2707:749dbdbd4a00

Merge with 0.7
author Matthew Wild <mwild1@gmail.com>
date Mon, 22 Feb 2010 01:48:42 +0000
parent 2706:c2dde8bda3fe
child 3013:518e3f6f9946
child 3233:8f78e8164032
comparison
equal deleted inserted replaced
2704:78af99ce9c07 2707:749dbdbd4a00
433 return 1; 433 return 1;
434 end 434 end
435 435
436 function commands.restart(arg) 436 function commands.restart(arg)
437 if arg[1] == "--help" then 437 if arg[1] == "--help" then
438 show_usage([[stop]], [[Stop and start a running Prosody server]]); 438 show_usage([[restart]], [[Restart a running Prosody server]]);
439 return 1; 439 return 1;
440 end 440 end
441 441
442 local ret = commands.stop(arg); 442 local ret = commands.stop(arg);
443 if ret == 0 then 443 if ret == 0 then
502 local http_errors = { 502 local http_errors = {
503 [404] = "Plugin not found, did you type the address correctly?" 503 [404] = "Plugin not found, did you type the address correctly?"
504 }; 504 };
505 505
506 function commands.addplugin(arg) 506 function commands.addplugin(arg)
507 if not arg[1] or arg[1] == "--help" then
508 show_usage("addplugin URL", "Download and install a plugin from a URL");
509 return 1;
510 end
507 local url = arg[1]; 511 local url = arg[1];
508 if url:match("^http://") then 512 if url:match("^http://") then
509 local http = require "socket.http"; 513 local http = require "socket.http";
510 show_message("Fetching..."); 514 show_message("Fetching...");
511 local code, err = http.request(url); 515 local code, err = http.request(url);
573 print(""); 577 print("");
574 print("Usage: "..arg[0].." COMMAND [OPTIONS]"); 578 print("Usage: "..arg[0].." COMMAND [OPTIONS]");
575 print(""); 579 print("");
576 print("Where COMMAND may be one of:\n"); 580 print("Where COMMAND may be one of:\n");
577 581
578 local hidden_commands = require "util.set".new{ "register", "unregister" }; 582 local hidden_commands = require "util.set".new{ "register", "unregister", "addplugin" };
579 local commands_order = { "adduser", "passwd", "deluser" }; 583 local commands_order = { "adduser", "passwd", "deluser", "start", "stop", "restart" };
580 584
581 local done = {}; 585 local done = {};
582 586
583 for _, command_name in ipairs(commands_order) do 587 for _, command_name in ipairs(commands_order) do
584 local command = commands[command_name]; 588 local command = commands[command_name];