Platformsh\Cli\Console\CustomMarkdownDescriptor::describeCommand PHP Method

describeCommand() protected method

protected describeCommand ( Command $command, array $options = [] )
$command Symfony\Component\Console\Command\Command
$options array
    protected function describeCommand(Command $command, array $options = [])
    {
        $command->getSynopsis();
        $command->mergeApplicationDefinition(false);
        $this->write($command->getName() . "\n" . str_repeat('-', strlen($command->getName())) . "\n");
        if ($description = $command->getDescription()) {
            $this->write("{$description}\n\n");
        }
        $aliases = $command instanceof CommandBase ? $command->getVisibleAliases() : $command->getAliases();
        if ($aliases) {
            $this->write('Aliases: ' . '`' . implode('`, `', $aliases) . '`' . "\n\n");
        }
        $this->write("## Usage:\n\n```\n" . $command->getSynopsis() . "\n```\n\n");
        if ($help = $command->getProcessedHelp()) {
            $this->write($help);
            $this->write("\n\n");
        }
        if ($command->getNativeDefinition()) {
            $this->describeInputDefinition($command->getNativeDefinition());
            $this->write("\n\n");
        }
        if ($command instanceof CommandBase && ($examples = $command->getExamples())) {
            $this->write('## Examples');
            $this->write("\n");
            $name = $command->getName();
            foreach ($examples as $arguments => $description) {
                $this->write("\n* {$description}:  \n  ```\n  " . $this->cliExecutableName . " {$name} {$arguments}\n  ```\n");
            }
            $this->write("\n");
        }
    }