Simplify how options are checked.

This commit is contained in:
mark_story 2012-01-17 21:57:22 -05:00
parent e080bb27b9
commit 5e495ad90c

View file

@ -465,7 +465,12 @@ class Shell extends Object {
} }
} }
if (is_array($options)) { if (is_array($options)) {
while ($in === '' || !(in_array(strtolower($in), $options) || in_array(strtoupper($in), $options) || in_array($in, $options))) { $options = array_merge(
array_map('strtolower', $options),
array_map('strtoupper', $options),
$options
);
while ($in === '' || !in_array($in, $options)) {
$in = $this->_getInput($prompt, $options, $default); $in = $this->_getInput($prompt, $options, $default);
} }
} }