# HG changeset patch # User Matthew Wild # Date 1241282908 -3600 # Node ID a817cbaa0f46c04e2c1cf92e9ef10b88ae920aab # Parent 5e9475bec5710a8c1d53a3934922d258c3ff1a9d prosodyctl: Multiple fixes for start/status/stop diff -r 5e9475bec571 -r a817cbaa0f46 prosodyctl --- a/prosodyctl Sat May 02 17:03:19 2009 +0100 +++ b/prosodyctl Sat May 02 17:48:28 2009 +0100 @@ -238,7 +238,11 @@ return 1; end -function commands.start() +function commands.start(arg) + if arg[1] == "--help" then + show_usage([[start]], [[Start Prosody]]); + return 1; + end local ok, ret = prosodyctl.isrunning(); if not ok then show_message(error_messages[ret]); @@ -264,7 +268,12 @@ return 1; end -function commands.status() +function commands.status(arg) + if arg[1] == "--help" then + show_usage([[status]], [[Reports the running status of Prosody]]); + return 1; + end + local ok, ret = prosodyctl.isrunning(); if not ok then show_message(error_messages[ret]); @@ -280,11 +289,19 @@ end show_message("Prosody is running with PID %s", ret or "(unknown)"); return 0; + else + show_message("Prosody is not running"); + return 2 end return 1; end -function commands.stop() +function commands.stop(arg) + if arg[1] == "--help" then + show_usage([[stop]], [[Stop a running Prosody server]]); + return 1; + end + if not prosodyctl.isrunning() then show_message("Prosody is not running"); return 1; @@ -293,7 +310,7 @@ local ok, ret = prosodyctl.stop(); if ok then return 0; end - show_message(error_messages[ret]) + show_message(error_messages[ret]); return 1; end