2 namespace Consolidation\TestUtils;
4 use Symfony\Component\Console\Command\Command;
5 use Symfony\Component\Console\Input\InputInterface;
6 use Symfony\Component\Console\Output\OutputInterface;
7 use Symfony\Component\Console\Input\InputOption;
9 class MyFooCommand extends Command
11 protected function configure()
15 ->setDescription('My foo command.')
16 ->setHelp('This command tests command option injection by echoing its options')
20 InputOption::VALUE_REQUIRED,
27 InputOption::VALUE_REQUIRED,
28 'What is the name of the thing we are naming',
34 InputOption::VALUE_REQUIRED,
35 'What is the base directory to use for this command',
40 protected function execute(InputInterface $input, OutputInterface $output)
42 $output->writeln('Enter my:foo');
43 $output->writeln('dir: ' . $input->getOption('dir'));
44 $output->writeln('name: ' . $input->getOption('name'));
45 $output->writeln('other: ' . $input->getOption('other'));