Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ReStructuredTextDescriptor.php

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

ReStructuredTextDescriptor

Namespace

Symfony\Component\Console\Descriptor

Code

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);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal