3 use Symfony\Component\Console\Command\Command;
4 use Symfony\Component\Console\Input\InputInterface;
5 use Symfony\Component\Console\Input\InputOption;
6 use Symfony\Component\Console\Output\OutputInterface;
8 class FooOptCommand extends Command
13 protected function configure()
17 ->setDescription('The foo:bar command')
18 ->setAliases(array('afoobar'))
19 ->addOption('fooopt', 'fo', InputOption::VALUE_OPTIONAL, 'fooopt description')
23 protected function interact(InputInterface $input, OutputInterface $output)
25 $output->writeln('interact called');
28 protected function execute(InputInterface $input, OutputInterface $output)
30 $this->input = $input;
31 $this->output = $output;
33 $output->writeln('called');
34 $output->writeln($this->input->getOption('fooopt'));