Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cff89a6

Browse filesBrowse files
committed
Showcase custom value completion
1 parent c750261 commit cff89a6
Copy full SHA for cff89a6

File tree

1 file changed

+17
-0
lines changed
Filter options

1 file changed

+17
-0
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Command/SecretsRemoveCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/SecretsRemoveCommand.php
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
use Symfony\Bundle\FrameworkBundle\Secrets\AbstractVault;
1515
use Symfony\Component\Console\Command\Command;
16+
use Symfony\Component\Console\Completion\Completion;
17+
use Symfony\Component\Console\Completion\CompletionInput;
1618
use Symfony\Component\Console\Input\InputArgument;
1719
use Symfony\Component\Console\Input\InputInterface;
1820
use Symfony\Component\Console\Input\InputOption;
@@ -80,4 +82,19 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8082

8183
return 0;
8284
}
85+
86+
public function complete(CompletionInput $input, Completion $completion): void
87+
{
88+
if (
89+
CompletionInput::TYPE_ARGUMENT_VALUE === $input->getCompletionType()
90+
&& 'name' === $input->getCompletionName()
91+
) {
92+
$vault = $input->getOption('local') ? $this->localVault : $this->vault;
93+
$completion->suggestValues(array_keys($this->vault->list(false)));
94+
95+
return;
96+
}
97+
98+
parent::complete($input, $completion);
99+
}
83100
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.