File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,9 @@ class App
5454 * @var array
5555 */
5656 private $ metas = [
57- 'name ' => 'My application ' ,
58- 'desc ' => 'My command line application ' ,
57+ 'name ' => 'My application ' ,
58+ 'desc ' => 'My command line application ' ,
59+ 'version ' => '0.2.1 '
5960 ];
6061
6162 /**
@@ -361,9 +362,13 @@ public function displayHelp(string $err = ''): void
361362
362363 // help
363364 $ desc = ucfirst ($ this ->metas ['desc ' ]);
365+ if ($ ver = $ this ->metas ['version ' ]) {
366+ $ desc .= "(<red>v $ ver</red>) " ;
367+ }
368+
364369 $ usage = "<cyan> {$ this ->script } COMMAND -h</cyan> " ;
365370
366- $ help = "$ desc \n<comment>Usage:</comment> $ usage \n<comment>Commands:</comment> \n" ;
371+ $ help = "$ desc \n\n <comment>Usage:</comment> $ usage \n<comment>Commands:</comment> \n" ;
367372 $ data = $ this ->messages ;
368373 ksort ($ data );
369374
You can’t perform that action at this time.
0 commit comments