Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Command;
- use Symfony\Component\Console\Command\Command;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Output\OutputInterface;
- class ProcessorCommand extends Command
- {
- protected function configure()
- {
- $this->setName('process')
- ->addArgument('directories', InputArgument::IS_ARRAY, 'Directories to process')
- ->addOption('extension', 'e', InputOption::VALUE_OPTIONAL, 'Filter by extension');
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $dirs = $input->getArgument('directories');
- $extension = $input->getOption('extension');
- foreach ($dirs as $dir) {
- $output->writeln(sprintf("<info>Leyendo archivos en %s ..</info>", $dir));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement