CliWorkaroundCommands.php in Tome 8
File
modules/tome_base/src/Commands/CliWorkaroundCommands.php
View source
<?php
namespace Drupal\tome_base\Commands;
use Consolidation\AnnotatedCommand\AnnotatedCommand;
use Consolidation\AnnotatedCommand\CommandData;
use Drush\Commands\DrushCommands;
use Drush\Drush;
class CliWorkaroundCommands extends DrushCommands {
public function preCommand(CommandData $commandData) {
foreach (Drush::getApplication()
->all('tome') as $name => $command) {
if (!$command instanceof AnnotatedCommand) {
$dupe_command = new AnnotatedCommand($name);
$dupe_command
->setDefinition($command
->getDefinition());
Drush::getApplication()
->add($dupe_command);
}
}
}
}