2 namespace Drupal\woot\Commands;
4 use Consolidation\AnnotatedCommand\AnnotatedCommand;
5 use Symfony\Component\Console\Command\Command;
6 use Symfony\Component\Console\Input\InputArgument;
7 use Symfony\Component\Console\Input\InputInterface;
8 use Symfony\Component\Console\Input\InputOption;
9 use Symfony\Component\Console\Output\OutputInterface;
12 * This is an annotated version of the example Symfony Console command
13 * from the documentation.
15 * See: http://symfony.com/doc/2.7/components/console/introduction.html#creating-a-basic-command
17 class AnnotatedGreetCommand extends AnnotatedCommand
22 * @command annotated:greet
23 * @arg string $name Who do you want to greet?
24 * @option boolean $yell If set, the task will yell in uppercase letters
26 protected function execute(InputInterface $input, OutputInterface $output)
28 $name = $input->getArgument('name');
30 $text = 'Hello '.$name;
35 if ($input->getOption('yell')) {
36 $text = strtoupper($text);
39 $output->writeln($text);