1
0
Fork 0

Fixes to global completion, working in some cases now

pull/10320/head
Jordi Boggiano 2022-05-12 23:11:22 +02:00
parent 0089a69c57
commit 6aa7e15373
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 6 additions and 2 deletions

View File

@ -36,12 +36,16 @@ class GlobalCommand extends BaseCommand
$suggestions->suggestValues(array_filter(array_map(function (Command $command) {
return $command->isHidden() ? null : $command->getName();
}, $application->all())));
return;
}
if ($application->has($commandName = $input->getArgument('command-name'))) {
$input = $this->prepareSubcommandInput($input, true);
$input = CompletionInput::fromString($input->__toString(), 3);
$command = $this->getApplication()->find($commandName);
$input = CompletionInput::fromString($input->__toString(), 2);
$command = $application->find($commandName);
$command->mergeApplicationDefinition();
$input->bind($command->getDefinition());
$command->complete($input, $suggestions);
}