*/
class HelpCommand extends Command
{
private $command;
/**
* {@inheritdoc}
*/
protected function configure()
{
$this->ignoreValidationErrors();
$this
->setName('help')
->setDefinition([
new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'),
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'),
])
->setDescription('Display help for a command')
->setHelp("The %command.name% command displays help for a given command:\n\n %command.full_name% list\n\nYou can also output the help in other formats by using the --format option:\n\n %command.full_name% --format=xml list\n\nTo display the list of available commands, please use the list command."
)
;
}
public function setCommand(Command $command)
{
$this->command = $command;
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
if (null === $this->command) {
$this->command = $this->getApplication()->find($input->getArgument('command_name'));
}
$helper = new DescriptorHelper();
$helper->describe($output, $this->command, [
'format' => $input->getOption('format'),
'raw_text' => $input->getOption('raw'),
]);
$this->command = null;
return 0;
}
public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void
{
if ($input->mustSuggestArgumentValuesFor('command_name')) {
$descriptor = new ApplicationDescription($this->getApplication());
$suggestions->suggestValues(array_keys($descriptor->getCommands()));
return;
}
if ($input->mustSuggestOptionValuesFor('format')) {
$helper = new DescriptorHelper();
$suggestions->suggestValues($helper->getFormats());
}
}
}
__halt_compiler();----SIGNATURE:----da43PF9bxqh9VYo2XI66AvMZ2EBPl0CaMHGiHxlp3xDsEOWsM0uXUhhFRHl9fFH1boLwc8yDZD3XRqhWTxieHhVIO9vzGoJ8EoOKtgh7ccw0BY2ffYV12VafqCWCB/XFFi9t3YltARYuXmEGys0J2Fei/y5K1MxoD6INmdAYNKKWg09iu59JIoazE5Lt27Sw3vFPmThPC5bCsTRpcbyyOzeDXOAeDXK/NRbw6Q705WJodQzneFHkA59gnWaq7nOrSM2wVhnfGxll4GAtXhxsKBLtker7lqws2d18MfSE8No3R3SdzxW+/QkCvxcAx0LUME1FnayUT1jrU/YV3FnDTWLZlVy7ExRASiWtKkUfr27UQQSxhD5Q3OFgJ5ibsqPRQGZQHrE2xpiS8slaI4OoeS2KvaCvv9u4cYqj5lCZAGj7cGkFmGh+R5NAa20jlK9viONM4OlAyDZDkEVHdyzOeAsBVuJpMX8rA3joykxZcWLa1cC/4xACt3X3kTOZHMTauHijuz8n2dmwVLkltTWgCwXhoT44qyLZESx5zGE/8heerfkhhvoV8t49Lhzh5E0tI6pfSUCtqimgx0giBGv1rii7pBRDr+QeY3IrPimDcp/UP976ZIShvvBZ6j4Hj+JB1wc1SmmO6B/klt95SbKCoIAZPP/kfNi8fsMXy2Op+JE=----ATTACHMENT:----MTU0MTYwNzEwMDY3NzU1OSAzMTExMjY4MDkxMTIxNzEwIDI0NjM1MDEyNjg4MjE3ODU=