1111
1212use Inhere \Console \Console ;
1313use Inhere \Console \GlobalOption ;
14- use Inhere \Console \Util \FormatUtil ;
1514use ReflectionClass ;
1615use Toolkit \Cli \Color \ColorTag ;
16+ use Toolkit \PFlag \FlagUtil ;
1717use Toolkit \Stdlib \Str ;
1818use Toolkit \Stdlib \Util \PhpDoc ;
1919use function array_merge ;
@@ -96,7 +96,7 @@ public function showCommandList(): void
9696 $ this ->beforeShowCommandList ();
9797
9898 $ ref = new ReflectionClass ($ this );
99- $ sName = lcfirst ( self ::getName () ?: $ ref ->getShortName ());
99+ $ sName = self ::getName () ?: lcfirst ( $ ref ->getShortName ());
100100
101101 if (!($ classDes = self ::getDesc ())) {
102102 $ classDes = PhpDoc::description ($ ref ->getDocComment ()) ?: 'No description for the command group ' ;
@@ -124,6 +124,7 @@ public function showCommandList(): void
124124 $ desc = $ defaultDes ;
125125 }
126126
127+ $ desc = ucfirst ($ desc );
127128 if ($ this ->isDisabled ($ cmd )) {
128129 if (!$ showDisabled ) {
129130 continue ;
@@ -151,7 +152,6 @@ public function showCommandList(): void
151152
152153 // if is alone running.
153154 if ($ detached = $ this ->isDetached ()) {
154- // $name = $sName . ' ';
155155 $ usage = "$ script <info>COMMAND</info> [--options ...] [arguments ...] " ;
156156 } else {
157157 $ name = $ sName . $ this ->delimiter ;
@@ -162,24 +162,25 @@ public function showCommandList(): void
162162 ];
163163 }
164164
165- $ globalOptions = [];
166- if ($ app = $ this ->app ) {
167- $ globalOptions = $ app ->getFlags ()->getOptsHelpLines ();
168- }
165+ // $globalOptions = [];
166+ // if ($app = $this->app) {
167+ // $globalOptions = $app->getFlags()->getOptsHelpLines();
168+ // }
169169
170170 $ this ->output ->startBuffer ();
171171 $ this ->output ->write (ucfirst ($ classDes ) . PHP_EOL );
172172
173+ $ alias = '' ;
173174 if ($ aliases = $ this ->getAliases ()) {
174- $ this -> output -> writef ( " <comment>Alias:</comment> %s \n" , implode (', ' , $ aliases )) ;
175+ $ alias = ' (alias: <info> ' . implode (', ' , $ aliases ) . ' </info>) ' ;
175176 }
177+ $ this ->output ->writef ("<comment>Name :</comment> %s%s \n" , $ sName , $ alias );
176178
177179 $ groupOptions = $ this ->flags ->getOptsHelpLines ();
178180 $ this ->output ->mList ([
179181 'Usage: ' => $ usage ,
180- //'Group Name:' => "<info>$sName</info>",
181- 'Group Options: ' => FormatUtil::alignOptions ($ groupOptions ),
182- 'Global Options: ' => FormatUtil::alignOptions ($ globalOptions ),
182+ 'Group Options: ' => FlagUtil::alignOptions ($ groupOptions ),
183+ // 'Global Options:' => FlagUtil::alignOptions($globalOptions),
183184 'Available Commands: ' => $ commands ,
184185 ], [
185186 'sepChar ' => ' ' ,
0 commit comments