8000 Zsh shell autocompletions by adhocore · Pull Request #43970 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Zsh shell autocompletions #43970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Prev Previous commit
Next Next commit
Add zsh completion writer (options with description)
  • Loading branch information
adhocore committed Nov 9, 2021
commit 2458f633bff61716b79ecd2b324f5a993dd00fa5
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\Console\Completion\Output;

use Symfony\Component\Console\Completion\CompletionSuggestions;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @author Jitendra A <adhocore@gmail.com>
*/
class ZshCompletionOutput implements CompletionOutputInterface
{
public function write(CompletionSuggestions $suggestions, OutputInterface $output): void
{
$options = $suggestions->getValueSuggestions();
foreach ($suggestions->getOptionSuggestions() as $option) {
$options[] = '--'.$option->getName()."\t".$option->getDescription();
}
$output->writeln(implode("\n", $options));
}
}
0