You are here

protected function MarkdownDescriptor::describeCommand in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Descriptor/MarkdownDescriptor.php \Symfony\Component\Console\Descriptor\MarkdownDescriptor::describeCommand()

Describes a Command instance.

Parameters

Command $command:

array $options:

Return value

string|mixed

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 90

Class

MarkdownDescriptor
Markdown descriptor.

Namespace

Symfony\Component\Console\Descriptor

Code

protected function describeCommand(Command $command, array $options = array()) {
  $command
    ->getSynopsis();
  $command
    ->mergeApplicationDefinition(false);
  $this
    ->write($command
    ->getName() . "\n" . str_repeat('-', strlen($command
    ->getName())) . "\n\n" . '* Description: ' . ($command
    ->getDescription() ?: '<none>') . "\n" . '* Usage:' . "\n\n" . array_reduce(array_merge(array(
    $command
      ->getSynopsis(),
  ), $command
    ->getAliases(), $command
    ->getUsages()), function ($carry, $usage) {
    return $carry .= '  * `' . $usage . '`' . "\n";
  }));
  if ($help = $command
    ->getProcessedHelp()) {
    $this
      ->write("\n");
    $this
      ->write($help);
  }
  if ($command
    ->getNativeDefinition()) {
    $this
      ->write("\n\n");
    $this
      ->describeInputDefinition($command
      ->getNativeDefinition());
  }
}