33namespace Salient \Cli ;
44
55use Salient \Cli \Exception \CliInvalidArgumentsException ;
6- use Salient \Console \Format \ConsoleFormatter as Formatter ;
7- use Salient \Console \Format \ConsoleManPageFormat ;
8- use Salient \Console \Format \ConsoleMarkdownFormat ;
6+ use Salient \Console \Format \Formatter ;
7+ use Salient \Console \Format \ManPageFormat ;
8+ use Salient \Console \Format \MarkdownFormat ;
99use Salient \Container \Application ;
1010use Salient \Contract \Cli \CliApplicationInterface ;
1111use Salient \Contract \Cli \CliCommandInterface ;
@@ -336,7 +336,7 @@ public function run()
336336 ) {
337337 $ usage = $ this ->getUsage ($ name , $ node );
338338 if ($ usage !== null ) {
339- Console::printOut ($ usage );
339+ Console::printStdio ($ usage );
340340 }
341341 $ this ->LastExitStatus =
342342 $ arg === null
@@ -419,7 +419,7 @@ public function run()
419419 && $ name !== null
420420 && ($ usage = $ this ->getUsage ($ name , $ node )) !== null
421421 ) {
422- Console::printOut ("\n" . $ usage );
422+ Console::printStdio ("\n" . $ usage );
423423 }
424424 $ this ->LastExitStatus = 1 ;
425425 return $ this ;
@@ -464,12 +464,12 @@ private function generateHelp(string $name, $node, int $target, string ...$args)
464464
465465 switch ($ target ) {
466466 case CliHelpTarget::MARKDOWN :
467- $ formats = ConsoleMarkdownFormat:: getTagFormats ( );
467+ $ formatter = MarkdownFormat:: getFormatter ( fn () => 80 );
468468 $ collapseSynopsis = Get::boolean ($ args [0 ] ?? null );
469469 break ;
470470
471471 case CliHelpTarget::MAN_PAGE :
472- $ formats = ConsoleManPageFormat:: getTagFormats ( );
472+ $ formatter = ManPageFormat:: getFormatter ( fn () => 80 );
473473 $ progName = $ this ->getProgramName ();
474474 printf (
475475 '%% %s(%d) %s | %s%s ' ,
@@ -485,7 +485,6 @@ private function generateHelp(string $name, $node, int $target, string ...$args)
485485 throw new InvalidArgumentException (sprintf ('Invalid CliHelpTarget: %d ' , $ target ));
486486 }
487487
488- $ formatter = new Formatter ($ formats , null , fn (): int => 80 );
489488 $ style = new CliHelpStyle ($ target , 80 , $ formatter );
490489
491490 if ($ collapseSynopsis !== null ) {
0 commit comments