Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 68d9365

Browse filesBrowse files
Fix command description display
1 parent 1616d36 commit 68d9365
Copy full SHA for 68d9365

File tree

7 files changed

+27
-1
lines changed
Filter options

7 files changed

+27
-1
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Descriptor/TextDescriptor.php
+9-1Lines changed: 9 additions & 1 deletion
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");
@@ -154,7 +161,8 @@ protected function describeCommand(Command $command, array $options = array())
154161
$this->writeText("\n");
155162
}
156163

157-
if ($help = $command->getProcessedHelp()) {
164+
$help = $command->getProcessedHelp();
165+
if ($help && $help !== $description) {
158166
$this->writeText("\n");
159167
$this->writeText('<comment>Help:</comment>', $options);
160168
$this->writeText("\n");

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Fixtures/application_run2.txt
+3Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Fixtures/application_run3.txt
+3Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Fixtures/command_1.txt
+3Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Fixtures/command_2.txt
+3Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Fixtures/command_astext.txt
+3Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Fixtures/command_mbstring.txt
+3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.