function ReStructuredTextDescriptor::describeCommand
Overrides Descriptor::describeCommand
1 call to ReStructuredTextDescriptor::describeCommand()
- ReStructuredTextDescriptor::describeCommands in vendor/
symfony/ console/ Descriptor/ ReStructuredTextDescriptor.php
File
-
vendor/
symfony/ console/ Descriptor/ ReStructuredTextDescriptor.php, line 115
Class
Namespace
Symfony\Component\Console\DescriptorCode
protected function describeCommand(Command $command, array $options = []) : void {
if ($options['short'] ?? false) {
$this->write('``' . $command->getName() . "``\n" . str_repeat($this->subsectionChar, Helper::width($command->getName())) . "\n\n" . ($command->getDescription() ? $command->getDescription() . "\n\n" : '') . "Usage\n" . str_repeat($this->paragraphsChar, 5) . "\n\n" . array_reduce($command->getAliases(), static fn($carry, $usage) => $carry . '- ``' . $usage . '``' . "\n"));
return;
}
$command->mergeApplicationDefinition(false);
foreach ($command->getAliases() as $alias) {
$this->write('.. _' . $alias . ":\n\n");
}
$this->write($command->getName() . "\n" . str_repeat($this->subsectionChar, Helper::width($command->getName())) . "\n\n" . ($command->getDescription() ? $command->getDescription() . "\n\n" : '') . "Usage\n" . str_repeat($this->subsubsectionChar, 5) . "\n\n" . array_reduce(array_merge([
$command->getSynopsis(),
], $command->getAliases(), $command->getUsages()), static fn($carry, $usage) => $carry . '- ``' . $usage . '``' . "\n"));
if ($help = $command->getProcessedHelp()) {
$this->write("\n");
$this->write($help);
}
$definition = $command->getDefinition();
if ($definition->getOptions() || $definition->getArguments()) {
$this->write("\n\n");
$this->describeInputDefinition($definition);
}
}