1111use Lkrms \Cli \Exception \CliInvalidArgumentsException ;
1212use Lkrms \Cli \Exception \CliUnknownValueException ;
1313use Lkrms \Cli \Support \CliHelpStyle ;
14- use Lkrms \Console \ConsoleFormatter as Formatter ;
1514use Lkrms \Facade \Console ;
1615use Lkrms \Utility \Arr ;
1716use Lkrms \Utility \Package ;
@@ -213,7 +212,7 @@ final public function __invoke(string ...$args): int
213212 if ($ this ->HasVersionArgument ) {
214213 $ appName = $ this ->App ->getAppName ();
215214 $ version = Package::version (true , true );
216- Console::stdout (" __ { $ appName} __ $ version" );
215+ Console::stdout (' __ ' . $ appName . ' __ ' . $ version );
217216 return 0 ;
218217 }
219218
@@ -616,11 +615,7 @@ private function getOptionsSynopsis(CliHelpStyle $style, ?string &$collapsed = n
616615 }
617616
618617 $ valueName = $ option ->formatValueName ();
619- // Preserve angle brackets around value names if they won't be
620- // formatted differently
621- if (!$ style ->HasMarkup ) {
622- $ valueName = Formatter::escapeTags ($ valueName );
623- }
618+ $ valueName = $ style ->maybeEscapeTags ($ valueName );
624619
625620 if ($ option ->IsPositional ) {
626621 if ($ option ->MultipleAllowed ) {
@@ -655,7 +650,7 @@ private function getOptionsSynopsis(CliHelpStyle $style, ?string &$collapsed = n
655650 . ($ option ->ValueRequired
656651 ? $ esc . ' ' . $ valueName . $ suffix
657652 : $ esc . '[ ' . $ valueName . '] ' . $ suffix )
658- : $ prefix . $ b . " -- { $ option ->Long }" . $ b
653+ : $ prefix . $ b . ' -- ' . $ option ->Long . $ b
659654 . ($ option ->ValueRequired
660655 ? $ esc . ' ' . $ valueName . $ suffix
661656 : $ esc . '[= ' . $ valueName . '] ' . $ suffix );
@@ -668,8 +663,8 @@ private function getOptionsSynopsis(CliHelpStyle $style, ?string &$collapsed = n
668663 }
669664
670665 $ collapsed = Arr::implode (' ' , [
671- $ optionalCount > 1 ? $ esc . '[<options>] ' : '' ,
672- $ optionalCount === 1 ? $ esc . '[<option>] ' : '' ,
666+ $ optionalCount > 1 ? $ esc . '[ ' . $ style -> maybeEscapeTags ( ' <options> ' ) . ' ] ' : '' ,
667+ $ optionalCount === 1 ? $ esc . '[ ' . $ style -> maybeEscapeTags ( ' <option> ' ) . ' ] ' : '' ,
673668 $ required ? implode (' ' , $ required ) : '' ,
674669 $ positional ? $ esc . '[ ' . $ b . '-- ' . $ b . '] ' . implode (' ' , $ positional ) : '' ,
675670 ]);
0 commit comments