From 137e7f2d2d05dcef6d48e6efeeced9e36641231e Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Sun, 29 Sep 2024 16:22:57 +0400 Subject: [PATCH] modifs.mineures sans commentaires --- wip/app/cli/Application.php | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/wip/app/cli/Application.php b/wip/app/cli/Application.php index 4fb105c..ef215bb 100644 --- a/wip/app/cli/Application.php +++ b/wip/app/cli/Application.php @@ -83,22 +83,40 @@ abstract class Application { /** @var bool faut-il installer le gestionnaire de signaux? */ 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 { fwrite(STDERR, "ERROR: $message\n"); 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; - array_splice($argv, 1, 1); + array_splice($argv, 1, 1); $argc--; $ec = 0; switch ($argv[1] ?? "infos") { + case "help": + self::_info(<<isRunning()) $runfile->wfKill(); else $ec = self::_error("not running"); break; - case "release-lock": case "release": case "rl": $runfile->release();