matomo
/
app
/
vendor
/
prefixed
/
symfony
/
console
/
Completion
/
Output
/
BashCompletionOutput.php
BashCompletionOutput.php
32 lines
| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This file is part of the Symfony package. |
| 5 | * |
| 6 | * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | * |
| 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | * file that was distributed with this source code. |
| 10 | */ |
| 11 | namespace Matomo\Dependencies\Symfony\Component\Console\Completion\Output; |
| 12 | |
| 13 | use Matomo\Dependencies\Symfony\Component\Console\Completion\CompletionSuggestions; |
| 14 | use Matomo\Dependencies\Symfony\Component\Console\Output\OutputInterface; |
| 15 | /** |
| 16 | * @author Wouter de Jong <wouter@wouterj.nl> |
| 17 | */ |
| 18 | class BashCompletionOutput implements CompletionOutputInterface |
| 19 | { |
| 20 | public function write(CompletionSuggestions $suggestions, OutputInterface $output) : void |
| 21 | { |
| 22 | $values = $suggestions->getValueSuggestions(); |
| 23 | foreach ($suggestions->getOptionSuggestions() as $option) { |
| 24 | $values[] = '--' . $option->getName(); |
| 25 | if ($option->isNegatable()) { |
| 26 | $values[] = '--no-' . $option->getName(); |
| 27 | } |
| 28 | } |
| 29 | $output->writeln(implode("\n", $values)); |
| 30 | } |
| 31 | } |
| 32 |