Skip to content

Commit

Permalink
use default answer if it is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Sep 29, 2017
1 parent fd8620b commit f0ee821
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Command/CloseIssueCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ private function getMessage()
*/
private function askChoices($prompt, $list, $errorMessage, $default = null)
{
// default given and present in $list, use that
if ($default && isset($list[$default])) {
return $default;
}

// avoid asking if answer is known
switch (count($list)) {
case 0:
Expand Down

0 comments on commit f0ee821

Please sign in to comment.