diff --git a/src/Command/Generate/CacheContextCommand.php b/src/Command/Generate/CacheContextCommand.php index 474082006..5ca9c0137 100644 --- a/src/Command/Generate/CacheContextCommand.php +++ b/src/Command/Generate/CacheContextCommand.php @@ -78,9 +78,13 @@ protected function configure() ->setName('generate:cache:context') ->setDescription($this->trans('commands.generate.cache.context.description')) ->setHelp($this->trans('commands.generate.cache.context.description')) - ->addOption('module', null, InputOption::VALUE_REQUIRED, $this->trans('commands.common.options.module')) ->addOption( - 'cache_context', + 'module', + null, + InputOption::VALUE_REQUIRED, + $this->trans('commands.common.options.module')) + ->addOption( + 'cache-context', null, InputOption::VALUE_OPTIONAL, $this->trans('commands.generate.cache.context.questions.name') @@ -112,7 +116,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } $module = $input->getOption('module'); - $cache_context = $input->getOption('cache_context'); + $cache_context = $input->getOption('cache-context'); $class = $input->getOption('class'); $services = $input->getOption('services'); @@ -140,13 +144,13 @@ protected function interact(InputInterface $input, OutputInterface $output) } // --cache_context option - $cache_context = $input->getOption('cache_context'); + $cache_context = $input->getOption('cache-context'); if (!$cache_context) { $cache_context = $io->ask( $this->trans('commands.generate.cache.context.questions.name'), sprintf('%s', $module) ); - $input->setOption('cache_context', $cache_context); + $input->setOption('cache-context', $cache_context); } // --class option