Skip to content

Commit

Permalink
Don't show "invalid selection" message when quitting
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Nov 18, 2019
1 parent 2db9750 commit 172e9df
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Command/I18nCommand.php
Expand Up @@ -50,8 +50,7 @@ public function execute(Arguments $args, ConsoleIo $io): ?int
$io->out('[H]elp');
$io->out('[Q]uit');

$choice = null;
while ($choice !== 'q') {
do {
$choice = strtolower($io->askChoice('What would you like to do?', ['E', 'I', 'H', 'Q']));
$code = null;
switch ($choice) {
Expand All @@ -64,6 +63,9 @@ public function execute(Arguments $args, ConsoleIo $io): ?int
case 'h':
$io->out($this->getOptionParser()->help());
break;
case 'q':
// Do nothing
break;
default:
$io->err(
'You have made an invalid selection. ' .
Expand All @@ -73,7 +75,7 @@ public function execute(Arguments $args, ConsoleIo $io): ?int
if ($code === static::CODE_ERROR) {
$this->abort();
}
}
} while ($choice !== 'q');

return static::CODE_SUCCESS;
}
Expand Down

0 comments on commit 172e9df

Please sign in to comment.