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

Breadcrumb

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

function ZshCompletionOutput::write

Overrides CompletionOutputInterface::write

File

vendor/symfony/console/Completion/Output/ZshCompletionOutput.php, line 22

Class

ZshCompletionOutput
@author Jitendra A <adhocore@gmail.com>

Namespace

Symfony\Component\Console\Completion\Output

Code

public function write(CompletionSuggestions $suggestions, OutputInterface $output) : void {
    $values = [];
    foreach ($suggestions->getValueSuggestions() as $value) {
        $values[] = $value->getValue() . ($value->getDescription() ? "\t" . $value->getDescription() : '');
    }
    foreach ($suggestions->getOptionSuggestions() as $option) {
        $values[] = '--' . $option->getName() . ($option->getDescription() ? "\t" . $option->getDescription() : '');
        if ($option->isNegatable()) {
            $values[] = '--no-' . $option->getName() . ($option->getDescription() ? "\t" . $option->getDescription() : '');
        }
    }
    $output->write(implode("\n", $values) . "\n");
}

API Navigation

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