X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrush%2Fdrush%2Ftests%2Fresources%2Fmodules%2Fd8%2Fwoot%2Fsrc%2FCommands%2FGreetCommand.php;fp=vendor%2Fdrush%2Fdrush%2Ftests%2Fresources%2Fmodules%2Fd8%2Fwoot%2Fsrc%2FCommands%2FGreetCommand.php;h=644630b7d912810d4702e7c14dde6378672fa2f5;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/drush/drush/tests/resources/modules/d8/woot/src/Commands/GreetCommand.php b/vendor/drush/drush/tests/resources/modules/d8/woot/src/Commands/GreetCommand.php new file mode 100644 index 000000000..644630b7d --- /dev/null +++ b/vendor/drush/drush/tests/resources/modules/d8/woot/src/Commands/GreetCommand.php @@ -0,0 +1,52 @@ +setName('demo:greet') + ->setDescription('Greet someone') + ->addArgument( + 'name', + InputArgument::OPTIONAL, + 'Who do you want to greet?' + ) + ->addOption( + 'yell', + null, + InputOption::VALUE_NONE, + 'If set, the task will yell in uppercase letters' + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $name = $input->getArgument('name'); + if ($name) { + $text = 'Hello '.$name; + } else { + $text = 'Hello'; + } + + if ($input->getOption('yell')) { + $text = strtoupper($text); + } + + $output->writeln($text); + } +}