Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4884d3e

Browse files
Fix command description display
1 parent 1616d36 commit 4884d3e

File tree

7 files changed

+25
-0
lines changed

7 files changed

+25
-0
lines changed

src/Symfony/Component/Console/Descriptor/TextDescriptor.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ protected function describeCommand(Command $command, array $options = array())
140140
$command->getSynopsis(false);
141141
$command->mergeApplicationDefinition(false);
142142

143+
if ($description = $command->getDescription()) {
144+
$this->writeText('<comment>Description:</comment>', $options);
145+
$this->writeText("\n");
146+
$this->writeText(' '.$description);
147+
$this->writeText("\n\n");
148+
}
149+
143150
$this->writeText('<comment>Usage:</comment>', $options);
144151
foreach (array_merge(array($command->getSynopsis(true)), $command->getAliases(), $command->getUsages()) as $usage) {
145152
$this->writeText("\n");

src/Symfony/Component/Console/Tests/Fixtures/application_run2.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Description:
2+
Displays help for a command
3+
14
Usage:
25
help [options] [--] [<command_name>]
36

src/Symfony/Component/Console/Tests/Fixtures/application_run3.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Description:
2+
Lists commands
3+
14
Usage:
25
list [options] [--] [<namespace>]
36

src/Symfony/Component/Console/Tests/Fixtures/command_1.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<comment>Description:</comment>
2+
command 1 description
3+
14
<comment>Usage:</comment>
25
descriptor:command1
36
alias1

src/Symfony/Component/Console/Tests/Fixtures/command_2.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<comment>Description:</comment>
2+
command 2 description
3+
14
<comment>Usage:</comment>
25
descriptor:command2 [options] [--] \<argument_name>
36
descriptor:command2 -o|--option_name \<argument_name>

src/Symfony/Component/Console/Tests/Fixtures/command_astext.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<comment>Description:</comment>
2+
description
3+
14
<comment>Usage:</comment>
25
namespace:name
36
name

src/Symfony/Component/Console/Tests/Fixtures/command_mbstring.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<comment>Description:</comment>
2+
command åèä description
3+
14
<comment>Usage:</comment>
25
descriptor:åèä [options] [--] \<argument_åèä>
36
descriptor:åèä -o|--option_name \<argument_name>

0 commit comments

Comments
 (0)