modifs.mineures sans commentaires
This commit is contained in:
parent
bd10883740
commit
137e7f2d2d
|
@ -83,22 +83,40 @@ abstract class Application {
|
||||||
/** @var bool faut-il installer le gestionnaire de signaux? */
|
/** @var bool faut-il installer le gestionnaire de signaux? */
|
||||||
const INSTALL_SIGNAL_HANDLER = false;
|
const INSTALL_SIGNAL_HANDLER = false;
|
||||||
|
|
||||||
|
private static function _info(string $message, int $ec=0): int {
|
||||||
|
fwrite(STDERR, "INFO: $message\n");
|
||||||
|
return $ec;
|
||||||
|
}
|
||||||
|
|
||||||
private static function _error(string $message, int $ec=1): int {
|
private static function _error(string $message, int $ec=1): int {
|
||||||
fwrite(STDERR, "ERROR: $message\n");
|
fwrite(STDERR, "ERROR: $message\n");
|
||||||
return $ec;
|
return $ec;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function _manage_runfile(int $argc, array $argv, RunFile $runfile): void {
|
static function _manage_runfile(int &$argc, array &$argv, RunFile $runfile): void {
|
||||||
if ($argc <= 1 || $argv[1] !== "//") return;
|
if ($argc <= 1 || $argv[1] !== "//") return;
|
||||||
array_splice($argv, 1, 1);
|
array_splice($argv, 1, 1); $argc--;
|
||||||
$ec = 0;
|
$ec = 0;
|
||||||
switch ($argv[1] ?? "infos") {
|
switch ($argv[1] ?? "infos") {
|
||||||
|
case "help":
|
||||||
|
self::_info(<<<EOT
|
||||||
|
kill
|
||||||
|
release
|
||||||
|
infos
|
||||||
|
dump
|
||||||
|
reset
|
||||||
|
|
||||||
|
EOT);
|
||||||
|
break;
|
||||||
|
case "start":
|
||||||
|
case "s":
|
||||||
|
array_splice($argv, 1, 1); $argc--;
|
||||||
|
return;
|
||||||
case "kill":
|
case "kill":
|
||||||
case "k":
|
case "k":
|
||||||
if ($runfile->isRunning()) $runfile->wfKill();
|
if ($runfile->isRunning()) $runfile->wfKill();
|
||||||
else $ec = self::_error("not running");
|
else $ec = self::_error("not running");
|
||||||
break;
|
break;
|
||||||
case "release-lock":
|
|
||||||
case "release":
|
case "release":
|
||||||
case "rl":
|
case "rl":
|
||||||
$runfile->release();
|
$runfile->release();
|
||||||
|
|
Loading…
Reference in New Issue