Security update for Core, with self-updated composer
[yaffs-website] / vendor / drupal / console-core / src / Command / ListCommand.php
index 883c3d42ba4b0281a8073cf746497ecd77fd7183..1b3e39e1ad3ec8dd1445ab217ae9780c83058e1f 100644 (file)
@@ -11,9 +11,6 @@ use Symfony\Component\Console\Input\InputDefinition;
 use Symfony\Component\Console\Input\InputOption;
 use Drupal\Console\Core\Helper\DescriptorHelper;
 use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Command\Command;
-use Drupal\Console\Core\Command\Shared\CommandTrait;
-use Drupal\Console\Core\Style\DrupalStyle;
 
 /**
  * Class ListCommand
@@ -22,8 +19,6 @@ use Drupal\Console\Core\Style\DrupalStyle;
  */
 class ListCommand extends Command
 {
-    use CommandTrait;
-
     /**
      * {@inheritdoc}
      */
@@ -49,26 +44,28 @@ class ListCommand extends Command
      */
     protected function execute(InputInterface $input, OutputInterface $output)
     {
-        $io = new DrupalStyle($input, $output);
-
         if ($input->getOption('xml')) {
-            $io->info(
+            $this->getIo()->info(
                 'The --xml option was deprecated in version 2.7 and will be removed in version 3.0. Use the --format option instead',
                 E_USER_DEPRECATED
             );
             $input->setOption('format', 'xml');
         }
+        $commandName = $input->getFirstArgument()?$input->getFirstArgument():'help';
         $helper = new DescriptorHelper();
         $helper->describe(
-            $io,
+            $this->getIo(),
             $this->getApplication(),
             [
                 'format' => $input->getOption('format'),
                 'raw_text' => $input->getOption('raw'),
                 'namespace' => $input->getArgument('namespace'),
-                'translator' => $this->getApplication()->getTranslator()
+                'translator' => $this->getApplication()->getTranslator(),
+                'command' => $this->getApplication()->find($commandName)
             ]
         );
+
+        $this->getIo()->newLine();
     }
 
     /**