|
2 | 2 |
|
3 | 3 | /**
|
4 | 4 | * @file
|
5 |
| - * Contains \Drupal\Console\Command\Generate\PluginBlockCommand. |
| 5 | + * Contains \Drupal\Console\Command\Generate\PluginMigrateSourceCommand. |
6 | 6 | */
|
7 | 7 |
|
8 | 8 | namespace Drupal\Console\Command\Generate;
|
9 | 9 |
|
10 |
| -use Symfony\Component\Console\Input\InputInterface; |
11 |
| -use Symfony\Component\Console\Input\InputOption; |
12 |
| -use Symfony\Component\Console\Output\OutputInterface; |
13 | 10 | use Drupal\Console\Core\Command\ContainerAwareCommand;
|
14 |
| -use Drupal\Console\Generator\PluginMigrateSourceGenerator; |
15 |
| -use Drupal\Console\Command\Shared\ModuleTrait; |
| 11 | +use Drupal\Console\Command\Shared\ArrayInputTrait; |
16 | 12 | use Drupal\Console\Command\Shared\ConfirmationTrait;
|
17 |
| -use Drupal\Console\Extension\Manager; |
18 |
| -use Drupal\Console\Utils\Validator; |
| 13 | +use Drupal\Console\Command\Shared\ModuleTrait; |
19 | 14 | use Drupal\Console\Core\Utils\StringConverter;
|
20 | 15 | use Drupal\Console\Core\Utils\ChainQueue;
|
| 16 | +use Drupal\Console\Extension\Manager; |
| 17 | +use Drupal\Console\Generator\PluginMigrateSourceGenerator; |
| 18 | +use Drupal\Console\Utils\Validator; |
21 | 19 | use Drupal\Core\Config\ConfigFactory;
|
22 | 20 | use Drupal\Core\Entity\EntityTypeManagerInterface;
|
23 | 21 | use Drupal\Core\Render\ElementInfoManagerInterface;
|
| 22 | +use Symfony\Component\Console\Input\InputInterface; |
| 23 | +use Symfony\Component\Console\Input\InputOption; |
| 24 | +use Symfony\Component\Console\Output\OutputInterface; |
24 | 25 |
|
25 | 26 | class PluginMigrateSourceCommand extends ContainerAwareCommand
|
26 | 27 | {
|
27 |
| - use ModuleTrait; |
| 28 | + use ArrayInputTrait; |
28 | 29 | use ConfirmationTrait;
|
| 30 | + use ModuleTrait; |
29 | 31 |
|
30 | 32 | /**
|
31 | 33 | * @var ConfigFactory
|
@@ -68,7 +70,7 @@ class PluginMigrateSourceCommand extends ContainerAwareCommand
|
68 | 70 | protected $elementInfoManager;
|
69 | 71 |
|
70 | 72 | /**
|
71 |
| - * PluginBlockCommand constructor. |
| 73 | + * PluginMigrateSourceCommand constructor. |
72 | 74 | *
|
73 | 75 | * @param ConfigFactory $configFactory
|
74 | 76 | * @param ChainQueue $chainQueue
|
@@ -167,6 +169,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
|
167 | 169 | $alias = $input->getOption('alias');
|
168 | 170 | $group_by = $input->getOption('group-by');
|
169 | 171 | $fields = $input->getOption('fields');
|
| 172 | + $no_interaction = $input->getOption('no-interaction'); |
| 173 | + // Parse nested data. |
| 174 | + if ($no_interaction) { |
| 175 | + $fields = $this->explodeInlineArray($fields); |
| 176 | + } |
170 | 177 |
|
171 | 178 | $this->generator->generate([
|
172 | 179 | 'module' => $module,
|
|
0 commit comments