merged branch geecu/help_command_find (PR #5558)
Commits
-------
6cbeff0
use ->find instead of ->get in the help command to allow command aliases to be used (e.g. "./app/console help do:sc:ge")
Discussion
----------
use ->find instead of ->get in the help command to allow command aliases...
... to be used (e.g. "./app/console help do:sc:ge")
This commit is contained in:
commit
a7b7314abd
@ -70,7 +70,7 @@ EOF
|
|||||||
protected function execute(InputInterface $input, OutputInterface $output)
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
if (null === $this->command) {
|
if (null === $this->command) {
|
||||||
$this->command = $this->getApplication()->get($input->getArgument('command_name'));
|
$this->command = $this->getApplication()->find($input->getArgument('command_name'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($input->getOption('xml')) {
|
if ($input->getOption('xml')) {
|
||||||
|
@ -22,6 +22,14 @@ class HelpCommandTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$command = new HelpCommand();
|
$command = new HelpCommand();
|
||||||
|
|
||||||
|
$application = new Application();
|
||||||
|
$command->setApplication($application);
|
||||||
|
$commandTester = new CommandTester($command);
|
||||||
|
$commandTester->execute(array('command_name' => 'li'));
|
||||||
|
$this->assertRegExp('/list \[--xml\] \[--raw\] \[namespace\]/', $commandTester->getDisplay(), '->execute() returns a text help for the given command alias');
|
||||||
|
|
||||||
|
$command = new HelpCommand();
|
||||||
|
|
||||||
$commandTester = new CommandTester($command);
|
$commandTester = new CommandTester($command);
|
||||||
$command->setCommand(new ListCommand());
|
$command->setCommand(new ListCommand());
|
||||||
$commandTester->execute(array());
|
$commandTester->execute(array());
|
||||||
|
Reference in New Issue
Block a user