src/Command/ResetTemplatesCommand.php
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $indexTemplate = $input->getOption('index');
        $deleteByPattern = $input->getOption('force-delete');

        if ($deleteByPattern) {
            $helper = $this->getHelper('question');
            $question = new ConfirmationQuestion('You are going to remove all template indexes. Are you sure?', false);

            if (!$helper->ask($input, $output, $question)) {
                return 1;
            }
        }

        if (null !== $indexTemplate) {
            $output->writeln(sprintf('<info>Resetting template</info> <comment>%s</comment>', $indexTemplate));
            $this->resetter->resetIndex($indexTemplate, $deleteByPattern);
        } else {
            $output->writeln('<info>Resetting all templates</info>');
            $this->resetter->resetAllIndexes($deleteByPattern);
        }

        return 0;
    }
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $indexTemplate = $input->getOption('index');
        $deleteByPattern = $input->getOption('force-delete');

        if ($deleteByPattern) {
            $helper = $this->getHelper('question');
            $question = new ConfirmationQuestion('You are going to remove all template indexes. Are you sure?', false);

            if (!$helper->ask($input, $output, $question)) {
                return 1;
            }
        }

        if (null !== $indexTemplate) {
            $output->writeln(sprintf('<info>Resetting template</info> <comment>%s</comment>', $indexTemplate));
            $this->resetter->resetIndex($indexTemplate, $deleteByPattern);
        } else {
            $output->writeln('<info>Resetting all templates</info>');
            $this->resetter->resetAllIndexes($deleteByPattern);
        }

        return 0;
    }
{@inheritdoc}