diff --git a/src/Console/Command/GenerateCommand.php b/src/Console/Command/GenerateCommand.php index 05c256e..6de81d7 100644 --- a/src/Console/Command/GenerateCommand.php +++ b/src/Console/Command/GenerateCommand.php @@ -4,8 +4,8 @@ namespace Opdavies\GmailFilterBuilder\Console\Command; use Opdavies\GmailFilterBuilder\Builder; 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; use Symfony\Component\Console\Style\SymfonyStyle; @@ -21,8 +21,8 @@ class GenerateCommand extends Command $this ->setName(self::NAME) ->setDefinition([ - new InputArgument('input-file', InputArgument::OPTIONAL, 'The name of the PHP file containing your filters.', 'filters.php'), - new InputArgument('output-file', InputArgument::OPTIONAL, 'The name of the XML file to generate.', 'filters.xml') + new InputOption('input-file', null, InputOption::VALUE_OPTIONAL, 'The name of the PHP file containing your filters.', 'filters.php'), + new InputOption('output-file', null, InputOption::VALUE_OPTIONAL, 'The name of the XML file to generate.', 'filters.xml') ]) ->setDescription('Generates XML for Gmail filters.') ; @@ -33,8 +33,8 @@ class GenerateCommand extends Command */ protected function execute(InputInterface $input, OutputInterface $output) { - $inputFile = $input->getArgument('input-file'); - $outputFile = $input->getArgument('output-file'); + $inputFile = $input->getOption('input-file'); + $outputFile = $input->getOption('output-file'); if (file_exists(__DIR__.'/../../../../'.$inputFile)) { $filters = require(__DIR__.'/../../../../'.$inputFile);