function MarkdownDescriptor::describeCommand
Overrides Descriptor::describeCommand
1 call to MarkdownDescriptor::describeCommand()
- MarkdownDescriptor::describeApplication in vendor/
symfony/ console/ Descriptor/ MarkdownDescriptor.php - Describes an Application instance.
File
-
vendor/
symfony/ console/ Descriptor/ MarkdownDescriptor.php, line 101
Class
- MarkdownDescriptor
- Markdown descriptor.
Namespace
Symfony\Component\Console\DescriptorCode
protected function describeCommand(Command $command, array $options = []) : void {
if ($options['short'] ?? false) {
$this->write('`' . $command->getName() . "`\n" . str_repeat('-', Helper::width($command->getName()) + 2) . "\n\n" . ($command->getDescription() ? $command->getDescription() . "\n\n" : '') . '### Usage' . "\n\n" . array_reduce($command->getAliases(), fn($carry, $usage) => $carry . '* `' . $usage . '`' . "\n"));
return;
}
$command->mergeApplicationDefinition(false);
$this->write('`' . $command->getName() . "`\n" . str_repeat('-', Helper::width($command->getName()) + 2) . "\n\n" . ($command->getDescription() ? $command->getDescription() . "\n\n" : '') . '### Usage' . "\n\n" . array_reduce(array_merge([
$command->getSynopsis(),
], $command->getAliases(), $command->getUsages()), 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);
}
}