Version 1
[yaffs-website] / vendor / drupal / console-core / src / Command / CompleteCommand.php
1 <?php
2
3 /**
4  * @file
5  * Contains \Drupal\Console\Core\CompleteCommand.
6  */
7
8 namespace Drupal\Console\Core\Command;
9
10 use Symfony\Component\Console\Input\InputInterface;
11 use Symfony\Component\Console\Output\OutputInterface;
12 use Symfony\Component\Console\Command\Command;
13 use Drupal\Console\Core\Command\Shared\CommandTrait;
14
15 class CompleteCommand extends Command
16 {
17     use CommandTrait;
18
19     /**
20      * {@inheritdoc}
21      */
22     protected function configure()
23     {
24         $this
25             ->setName('complete')
26             ->setDescription($this->trans('commands.complete.description'));
27     }
28
29     /**
30      * {@inheritdoc}
31      */
32     protected function execute(InputInterface $input, OutputInterface $output)
33     {
34         $commands = array_keys($this->getApplication()->all());
35         asort($commands);
36         $output->writeln($commands);
37
38         return 0;
39     }
40 }