8000 Auto-select a consumable receiver if there is only one · symfony/symfony@0425c3f · GitHub
[go: up one dir, main page]

Skip to content

Commit 0425c3f

Browse files
committed
Auto-select a consumable receiver if there is only one
Resolves #51556
1 parent 58aef51 commit 0425c3f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ protected function interact(InputInterface $input, OutputInterface $output)
136136
$io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output) 8653 ;
137137

138138
if ($this->receiverNames && !$input->getArgument('receivers')) {
139+
if (1 === \count($this->receiverNames)) {
140+
$input->setArgument('receivers', $this->receiverNames);
141+
142+
return;
143+
}
144+
139145
$io->block('Which transports/receivers do you want to consume?', null, 'fg=white;bg=blue', ' ', true);
140146

141147
$io->writeln('Choose which receivers you want to consume messages from in order of priority.');

0 commit comments

Comments
 (0)
0