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
54
54
* @var array
55
55
*/
56
56
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 '
59
60
];
60
61
61
62
/**
@@ -361,9 +362,13 @@ public function displayHelp(string $err = ''): void
361
362
362
363
// help
363
364
$ desc = ucfirst ($ this ->metas ['desc ' ]);
365
+ if ($ ver = $ this ->metas ['version ' ]) {
366
+ $ desc .= "(<red>v $ ver</red>) " ;
367
+ }
368
+
364
369
$ usage = "<cyan> {$ this ->script } COMMAND -h</cyan> " ;
365
370
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" ;
367
372
$ data = $ this ->messages ;
368
373
ksort ($ data );
369
374
You can’t perform that action at this time.
0 commit comments