Commit 434d31dd by Alexander Makarov

better code for prompt

parent b1f9bf5b
......@@ -325,15 +325,13 @@ abstract class Command extends \yii\base\Component
} else {
echo $message;
$input = fgets(STDIN);
if($input !== false) {
$input = trim($input);
}
}
if($input === false) {
return false;
}
else {
return empty($input) ? $default : $input;
$input = trim($input);
return $input==='' ? $default : $input;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment