@@ -150,17 +150,14 @@ public function showCommandList(): void
150150 $ name = $ sName . $ this ->delimiter ;
151151 // $usage = "$script {$name}<info>{command}</info> [--options ...] [arguments ...]";
152152 $ usage = [
153- "$ script $ name <info>COMMAND</info> [--options ...] [arguments ...] " ,
154- "$ script $ sName <info>COMMAND</info> [--options ...] [arguments ...] " ,
153+ "$ script [--global options] $ sName [--group options] <info>COMMAND</info> [--options ...] [arguments ...] " ,
154+ "$ script [--global options] $ name <info>COMMAND</info> [--options ...] [arguments ...] " ,
155155 ];
156156 }
157157
158- $ globalOptions = static :: $ globalOptions ;
158+ $ globalOptions = [] ;
159159 if ($ app = $ this ->getApp ()) {
160- $ globalOptions = array_merge (
161- $ app ->getFlags ()->getOptsHelpData (),
162- static ::$ globalOptions
163- );
160+ $ globalOptions = $ app ->getFlags ()->getOptsHelpData ();
164161 }
165162
166163 $ this ->output ->startBuffer ();
@@ -170,16 +167,18 @@ public function showCommandList(): void
170167 $ this ->output ->writef ("<comment>Alias:</comment> %s \n" , implode (', ' , $ aliases ));
171168 }
172169
170+ $ groupOptions = $ this ->flags ->getOptsHelpData ();
173171 $ this ->output ->mList ([
174172 'Usage: ' => $ usage ,
175173 //'Group Name:' => "<info>$sName</info>",
174+ 'Group Options: ' => FormatUtil::alignOptions ($ groupOptions ),
176175 'Global Options: ' => FormatUtil::alignOptions ($ globalOptions ),
177176 'Available Commands: ' => $ commands ,
178177 ], [
179178 'sepChar ' => ' ' ,
180179 ]);
181180
182- $ msgTpl = 'More information about a command, please see: <cyan>%s %s {command} -h</cyan> ' ;
181+ $ msgTpl = 'More information about a command, please see: <cyan>%s %s COMMAND -h</cyan> ' ;
183182 $ this ->output ->write (sprintf ($ msgTpl , $ script , $ detached ? '' : $ sName ));
184183 $ this ->output ->flush ();
185184 }
0 commit comments