Skip to content

Commit

Permalink
Parameter cache-context fixed (#3374)
Browse files Browse the repository at this point in the history
* Parameter cache-context fixed

* Module option properly indented
  • Loading branch information
CoyoteRulea authored and enzolutions committed Jul 3, 2017
1 parent 9f42a0f commit bd9f2ce
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/Command/Generate/CacheContextCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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');

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bd9f2ce

Please sign in to comment.