Security update for Core, with self-updated composer
[yaffs-website] / vendor / drupal / console-core / src / Command / HelpCommand.php
index c497341baab853cdbd59958f29e50609385b9c9e..a79fbd2e877f53a9f92394e7c849e5e929b936bd 100644 (file)
@@ -12,9 +12,6 @@ use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Input\InputDefinition;
 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;
 use Drupal\Console\Core\Helper\DescriptorHelper;
 
 /**
@@ -24,8 +21,6 @@ use Drupal\Console\Core\Helper\DescriptorHelper;
  */
 class HelpCommand extends Command
 {
-    use CommandTrait;
-
     private $command;
 
     /**
@@ -58,20 +53,18 @@ class HelpCommand extends Command
      */
     protected function execute(InputInterface $input, OutputInterface $output)
     {
-        $io = new DrupalStyle($input, $output);
-
         if (null === $this->command) {
             $this->command = $this->getApplication()->find($input->getArgument('command_name'));
         }
 
         if ($input->getOption('xml')) {
-            $io->info($this->trans('commands.help.messages.deprecated'), E_USER_DEPRECATED);
+            $this->getIo()->info($this->trans('commands.help.messages.deprecated'), E_USER_DEPRECATED);
             $input->setOption('format', 'xml');
         }
 
         $helper = new DescriptorHelper();
         $helper->describe(
-            $io,
+            $this->getIo(),
             $this->command,
             [
                 'format' => $input->getOption('format'),
@@ -82,6 +75,7 @@ class HelpCommand extends Command
         );
 
         $this->command = null;
+        $this->getIo()->newLine();
     }
 
     /**
@@ -91,7 +85,7 @@ class HelpCommand extends Command
     {
         return new InputDefinition(
             [
-            new InputArgument('command_name', InputArgument::OPTIONAL, $this->trans('commands.help.arguments.command_name'), 'help'),
+            new InputArgument('command_name', InputArgument::OPTIONAL, $this->trans('commands.help.arguments.command-name'), 'help'),
             new InputOption('xml', null, InputOption::VALUE_NONE, $this->trans('commands.help.options.xml')),
             new InputOption('raw', null, InputOption::VALUE_NONE, $this->trans('commands.help.options.raw')),
             new InputOption('format', null, InputOption::VALUE_REQUIRED, $this->trans('commands.help.options.format'), 'txt'),