addArgument('source', InputArgument::OPTIONAL, 'the website source to crawle'); $this->addOption('date', null, InputOption::VALUE_OPTIONAL, 'Date interval to crawle', null); } #[\Override] protected function initialize(InputInterface $input, OutputInterface $output): void { $this->io = new SymfonyStyle($input, $output); } #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { /** @var string|null $source */ $source = $input->getArgument('source'); /** @var string|null $date */ $date = $input->getOption('date'); $confirmation = $this->io->confirm('This can take a while, would like to continue ?', false); if ($confirmation) { $this->commandBus->handle(new ExportArticles( source: $source, date: $date !== null ? DateRange::from($date) : null )); } $this->io->success('articles exported successfully'); return Command::SUCCESS; } }