File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -282,4 +282,5 @@ $reader->read('abc', 'trim');
282282
283283### Related
284284
285- - [ adhocore/phalcon-ext] ( https://github.com/adhocore/phalcon-ext )
285+ - [ adhocore/phalcon-ext] ( https://github.com/adhocore/phalcon-ext ) Phalcon extension using ` adhocore/cli `
286+ - [ adhocore/phint] ( https://github.com/adhocore/phint ) PHP project scaffolding app using ` adhocore/cli `
Original file line number Diff line number Diff line change @@ -315,6 +315,10 @@ public function showHelp()
315315 ->showArgumentsHelp ($ this ->allArguments ())
316316 ->showOptionsHelp ($ this ->allOptions (), '' , 'Legend: <required> [optional] ' );
317317
318+ if ($ this ->_usage ) {
319+ $ writer ->eol ()->greenBold ('Usage Examples: ' , true )->raw (\trim ($ this ->_usage ))->eol ();
320+ }
321+
318322 return $ this ->emit ('_exit ' , 0 );
319323 }
320324
Original file line number Diff line number Diff line change @@ -22,12 +22,16 @@ public function test_V()
2222 public function test_help ()
2323 {
2424 $ p = $ this ->newCommand ()
25- ->arguments ('[arg] ' )
25+ ->argument ('[arg] ' , ' Some desc ' )
2626 ->option ('-o --option ' )
27+ ->usage ('cmdname --option opt <arg> ' )
2728 ->parse (['php ' , '--help ' ]);
2829
2930 $ this ->assertContains ('cmdname ' , $ buffer = $ this ->buffer ());
31+ $ this ->assertContains ('Usage Examples: ' , $ buffer );
32+ $ this ->assertContains ('--option opt <arg> ' , $ buffer );
3033 $ this ->assertContains ('[arg] ' , $ buffer );
34+ $ this ->assertContains ('Some desc ' , $ buffer );
3135 $ this ->assertContains ('[-o|--option] ' , $ buffer );
3236 }
3337
You can’t perform that action at this time.
0 commit comments