->setName('generate:plugin:fieldformatter')
->setDescription($this->trans('commands.generate.plugin.fieldformatter.description'))
->setHelp($this->trans('commands.generate.plugin.fieldformatter.help'))
- ->addOption('module', '', InputOption::VALUE_REQUIRED, $this->trans('commands.common.options.module'))
+ ->addOption('module', null, InputOption::VALUE_REQUIRED, $this->trans('commands.common.options.module'))
->addOption(
'class',
- '',
+ null,
InputOption::VALUE_REQUIRED,
$this->trans('commands.generate.plugin.fieldformatter.options.class')
)
->addOption(
'label',
- '',
+ null,
InputOption::VALUE_OPTIONAL,
$this->trans('commands.generate.plugin.fieldformatter.options.label')
)
->addOption(
'plugin-id',
- '',
+ null,
InputOption::VALUE_OPTIONAL,
$this->trans('commands.generate.plugin.fieldformatter.options.plugin-id')
)
->addOption(
'field-type',
- '',
+ null,
InputOption::VALUE_OPTIONAL,
$this->trans('commands.generate.plugin.fieldformatter.options.field-type')
);
// @see use Drupal\Console\Command\Shared\ConfirmationTrait::confirmGeneration
if (!$this->confirmGeneration($io)) {
- return;
+ return 1;
}
$module = $input->getOption('module');
$this->generator->generate($module, $class_name, $label, $plugin_id, $field_type);
$this->chainQueue->addCommand('cache:rebuild', ['cache' => 'discovery']);
+
+ return 0;
}
protected function interact(InputInterface $input, OutputInterface $output)