[console] Use the description when no help is available
This commit is contained in:
parent
9962f36f97
commit
e5d3f2567d
|
@ -484,7 +484,7 @@ class Command
|
|||
*/
|
||||
public function getHelp()
|
||||
{
|
||||
return $this->help;
|
||||
return $this->help ?: $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -131,6 +131,8 @@ class CommandTest extends \PHPUnit_Framework_TestCase
|
|||
$ret = $command->setHelp('help1');
|
||||
$this->assertEquals($command, $ret, '->setHelp() implements a fluent interface');
|
||||
$this->assertEquals('help1', $command->getHelp(), '->setHelp() sets the help');
|
||||
$command->setHelp('');
|
||||
$this->assertEquals('description', $command->getHelp(), '->getHelp() fallback to the description');
|
||||
}
|
||||
|
||||
public function testGetProcessedHelp()
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
<command id="foo:bar" name="foo:bar">
|
||||
<usage>foo:bar</usage>
|
||||
<description>The foo:bar command</description>
|
||||
<help/>
|
||||
<help>The foo:bar command</help>
|
||||
<aliases>
|
||||
<alias>afoobar</alias>
|
||||
</aliases>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<command id="foo:bar" name="foo:bar">
|
||||
<usage>foo:bar</usage>
|
||||
<description>The foo:bar command</description>
|
||||
<help/>
|
||||
<help>The foo:bar command</help>
|
||||
<aliases>
|
||||
<alias>afoobar</alias>
|
||||
</aliases>
|
||||
|
|
Reference in New Issue