* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Console\Command; use Symfony\Component\Console\Completion\CompletionInput; use Symfony\Component\Console\Completion\CompletionSuggestions; use Symfony\Component\Console\Descriptor\ApplicationDescription; use Symfony\Component\Console\Helper\DescriptorHelper; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; /** * HelpCommand displays the help for a given command. * * @author Fabien Potencier */ 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(<<<'EOF' The %command.name% command displays help for a given command: %command.full_name% list You can also output the help in other formats by using the --format option: %command.full_name% --format=xml list To display the list of available commands, please use the list command. EOF ) ; } 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:----uG8cdEMKXXIg3BwEjHV5d1l1ZchMQJNkPSTc2MIgAmHxQWRWaAQc9aoQTfI/+LlyYqafdfo0tALnUOxSnMzpd+vx/WHqxt4Qei3fIskBpeCYv0t/MfAXe6mXrhrk+InQ2XoNKAlyWGIWOoO32UQTZSo3JOClICLW2lCTZ6sVaLNa+ug/ttPMflHrMsxbRd6PJA2jtQK3x9rgOiwbrR6bWmATjksPreTDpTxyddK6mDpA2z1C/t66fWRjB4evgirpW+as8filRn7S/X9qBNGj7drxu3IC+DB5ucro4ZcLqM3Qk/1roW6MhIHQ0uhCrQPsID1wctkATceZF3vjcP+JoqyxWrLwaMyQy15LdtI+Ps0I646kGif4XLij6Ul24cWS1PN0acLIsz6a7HKx0WReg1wlPn0XiKHxjl8k4xWtHYeKPmxoehOnqW34FWaW0zM4//qPYJ1jVvU5M//OoqBxkQr+4LiCUxJJ1kRDSilbsv2w6BKyz+WM6TpwrFTiYqISyK0ET+aq1AiuxxDsXVCwYbtKZeErk4NrI6tGpHkJHYQGkW+Hlb7lfcBd5+S8xcgz9XIMdcFtD+XYrr3tdj6pbIH8CbvV4qK/TReQ19eNCLPen0cLxwuBEWoSBIkZOH97dGG7u0tqJeCk8LqrHVtJ9ScQl/Vm1P31bqBaJrhWWIU=----ATTACHMENT:----MjQ5ODc0NjA1OTEwMTMxMCA5MjQ0ODc0NjM1MzE0NjQ3IDY1OTk5MzAwMjY2OTQ1NDQ=