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;
/**
*/
class HelpCommand extends Command
{
- use CommandTrait;
-
private $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'),
);
$this->command = null;
+ $this->getIo()->newLine();
}
/**
{
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'),