@@ -23,23 +23,28 @@ public function __construct(
2323 ) {
2424 }
2525
26- #[ConsoleCommand(name: 'command:monitor ' )]
26+ #[ConsoleCommand(name: 'command:monitor ' , description: ' Monitors and executes pending async commands ' )]
2727 public function __invoke (): void
2828 {
29- $ this ->success ('Monitoring for new commands. Press ctrl+c to stop. ' );
29+ $ this ->info ('Monitoring for new commands. Press <em>Ctrl+C</em> to stop. ' );
30+ $ this ->writeln ();
3031
3132 /** @var \Symfony\Component\Process\Process[] $processes */
3233 $ processes = [];
3334
3435 while (true ) { // @phpstan-ignore-line
3536 foreach ($ processes as $ uuid => $ process ) {
36- $ time = new DateTimeImmutable ();
37-
3837 if ($ process ->isTerminated ()) {
3938 if ($ process ->isSuccessful ()) {
40- $ this ->writeln ("<style= \"fg-green \"> {$ uuid }</style> finished at {$ time ->format ('Y-m-d H:i:s ' )}" );
39+ $ this ->console ->keyValue (
40+ key: "<style='fg-gray'> {$ uuid }</style> " ,
41+ value: "<style='fg-green bold'>SUCCESS</style> " ,
42+ );
4143 } else {
42- $ this ->writeln ("<style= \"fg-red \"> {$ uuid }</style> failed at {$ time ->format ('Y-m-d H:i:s ' )}" );
44+ $ this ->console ->keyValue (
45+ key: "<style='fg-gray'> {$ uuid }</style> " ,
46+ value: "<style='fg-red bold'>FAILED</style> " ,
47+ );
4348 }
4449
4550 if ($ output = trim ($ process ->getOutput ())) {
@@ -73,7 +78,10 @@ public function __invoke(): void
7378 $ uuid = $ availableCommands ->keys ()->first ();
7479
7580 $ time = new DateTimeImmutable ();
76- $ this ->writeln ("<h2> {$ uuid }</h2> started at {$ time ->format ('Y-m-d H:i:s ' )}" );
81+ $ this ->console ->keyValue (
82+ key: $ uuid ,
83+ value: "<style='fg-gray'> {$ time ->format ('Y-m-d H:i:s ' )}</style> " ,
84+ );
7785
7886 $ process = new Process ([
7987 $ this ->argumentBag ->getBinaryPath (),
0 commit comments