File tree 1 file changed +15
-1
lines changed
Filter options
src/Symfony/Bundle/FrameworkBundle/Command
1 file changed +15
-1
lines changed
Original file line number Diff line number Diff line change 13
13
14
14
use Symfony \Bundle \FrameworkBundle \Secrets \AbstractVault ;
15
15
use Symfony \Component \Console \Command \Command ;
16
+ use Symfony \Component \Console \Completion \CompletionInput ;
17
+ use Symfony \Component \Console \Completion \CompletionInterface ;
18
+ use Symfony \Component \Console \Completion \CompletionSuggestions ;
16
19
use Symfony \Component \Console \Input \InputArgument ;
17
20
use Symfony \Component \Console \Input \InputInterface ;
18
21
use Symfony \Component \Console \Input \InputOption ;
26
29
*
27
30
* @internal
28
31
*/
29
- final class SecretsRemoveCommand extends Command
32
+ final class SecretsRemoveCommand extends Command implements CompletionInterface
30
33
{
31
34
protected static $ defaultName = 'secrets:remove ' ;
32
35
protected static $ defaultDescription = 'Remove a secret from the vault ' ;
@@ -80,4 +83,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int
80
83
81
84
return 0 ;
82
85
}
86
+
87
+ public function complete (CompletionInput $ input , CompletionSuggestions $ suggestions ): void
88
+ {
89
+ if (!$ input ->mustSuggestArgumentValuesFor ('name ' )) {
90
+ return ;
91
+ }
92
+
93
+ $ vault = $ input ->getOption ('local ' ) ? $ this ->localVault : $ this ->vault ;
94
+ $ vaultKeys = array_keys ($ this ->vault ->list (false ));
95
+ $ suggestions ->suggestValues (array_intersect ($ vaultKeys , array_keys ($ vault ->list (false ))));
96
+ }
83
97
}
You can’t perform that action at this time.
0 commit comments