You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 5.4: (27 commits)
feat: add completion for DebugAutowiring search argument
[Routing] Add support for aliasing routes
[DependencyInjection] only allow `ReflectionNamedType` for `ServiceSubscriberTrait`
Fix CS
[Console] Open CompleteCommand for custom outputs
[Intl] Update the ICU data to 70.1
[Messenger] Add completion for failed messages commands.
Fix tests
Fixing missing full_stack variable that's needed by toolbar.html.twig
[PropertyInfo] Bump phpstan/phpdoc-parser
[Security] Backport type fixes
[VarExporter] escape unicode chars involved in directionality
[Framework] Add completion to debug:container
[Messenger] Add completion to command messenger:consume
[Intl] Update the ICU data to 70.1
Fix more generic types
Default access_decision_manager.strategy option with merge.
Fix typos
Update validators.ca.xlf
Add missing Validator translations for Estonian
...
Signed-off-by: Alexander M. Turek <[email protected]>
Copy file name to clipboardExpand all lines: Command/CompleteCommand.php
+15-6Lines changed: 15 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -31,16 +31,25 @@ final class CompleteCommand extends Command
31
31
protectedstatic$defaultName = '|_complete';
32
32
protectedstatic$defaultDescription = 'Internal command to provide shell completion suggestions';
33
33
34
-
privatestatic$completionOutputs = [
35
-
'bash' => BashCompletionOutput::class,
36
-
];
34
+
private$completionOutputs;
37
35
38
36
private$isDebug = false;
39
37
38
+
/**
39
+
* @param array<string, class-string<CompletionOutputInterface>> $completionOutputs A list of additional completion outputs, with shell name as key and FQCN as value
->addOption('shell', 's', InputOption::VALUE_REQUIRED, 'The shell type (e.g. "bash")')
52
+
->addOption('shell', 's', InputOption::VALUE_REQUIRED, 'The shell type ("'.implode('", "', array_keys($this->completionOutputs)).'")')
44
53
->addOption('input', 'i', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'An array of input tokens (e.g. COMP_WORDS or argv)')
45
54
->addOption('current', 'c', InputOption::VALUE_REQUIRED, 'The index of the "input" array that the cursor is in (e.g. COMP_CWORD)')
46
55
->addOption('symfony', 'S', InputOption::VALUE_REQUIRED, 'The version of the completion script')
@@ -71,8 +80,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
71
80
thrownew \RuntimeException('The "--shell" option must be set.');
72
81
}
73
82
74
-
if (!$completionOutput = self::$completionOutputs[$shell] ?? false) {
75
-
thrownew \RuntimeException(sprintf('Shell completion is not supported for your shell: "%s" (supported: "%s").', $shell, implode('", "', array_keys(self::$completionOutputs))));
83
+
if (!$completionOutput = $this->completionOutputs[$shell] ?? false) {
84
+
thrownew \RuntimeException(sprintf('Shell completion is not supported for your shell: "%s" (supported: "%s").', $shell, implode('", "', array_keys($this->completionOutputs))));
0 commit comments