Skip to content

Commit 4220272

Browse files
authored
[console] Add command name property. (hechoendrupal#34)
1 parent 30d37c6 commit 4220272

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/ConsoleApplication.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ class ConsoleApplication extends Application
2121
*/
2222
protected $container;
2323

24+
/**
25+
* @var string
26+
*/
27+
protected $commandName;
28+
2429
/**
2530
* ConsoleApplication constructor.
2631
* @param ContainerInterface $container
@@ -62,6 +67,9 @@ public function trans($key)
6267

6368
public function doRun(InputInterface $input, OutputInterface $output)
6469
{
70+
if ($commandName = $this->getCommandName($input)) {
71+
$this->commandName = $commandName;
72+
}
6573
$this->registerEvents();
6674
$this->registerCommandsFromAutoWireConfiguration();
6775
return parent::doRun(

0 commit comments

Comments
 (0)