@@ -39,6 +39,13 @@ abstract class Controller extends AbstractCommand
3939 */
4040 protected $ notFoundCallback = 'notFound ' ;
4141
42+ /**
43+ * @var string
44+ */
45+ public $ delimiter = '/ ' ; // '/' ':'
46+
47+ protected $ showMore = true ;
48+
4249 /**
4350 * load command configure
4451 */
@@ -62,7 +69,7 @@ protected function configure()
6269 protected function execute ($ input , $ output )
6370 {
6471 $ action = $ this ->action ?: $ this ->defaultAction ;
65- $ action = Helper::transName (trim ($ action , ' / ' ));
72+ $ action = Helper::transName (trim ($ action , $ this -> delimiter ));
6673
6774 $ method = $ this ->actionSuffix ? $ action . ucfirst ($ this ->actionSuffix ) : $ action ;
6875
@@ -165,14 +172,16 @@ final protected function showCommandList()
165172 }
166173 }
167174
175+ $ sep = $ this ->delimiter ;
176+ $ name = $ sName . $ sep ;
168177 $ this ->output ->mList ([
169178 'Description: ' => $ classDes ,
170- 'Usage: ' => "$ sName / [command] [arguments] [options] " ,
179+ 'Usage: ' => "{ $ name } [command] [arguments] [options] " ,
171180 'Group Name: ' => "<info> $ sName</info> " ,
172181 'Commands: ' => $ commands ,
173182 'Options: ' => [
174183 '--help,-h ' => 'Show help of the command group or specified command action ' ,
175- "\nMore information please use: <cyan> $ sName / [command] -h</cyan> OR <cyan>$ sName / help [command]</cyan> "
184+ $ this -> showMore ? "\nMore information please use <cyan> { $ name } [command] -h</cyan> OR <cyan> { $ name } help [command]</cyan> " : ''
176185 ],
177186 ]);
178187 }
0 commit comments