}
$options[$option] = $param;
}
+ } elseif ( $arg == '-' ) {
+ # Lonely "-", often used to indicate stdin or stdout.
+ $args[] = $arg;
} elseif ( substr( $arg, 0, 1 ) == '-' ) {
# Short options
$argLength = strlen( $arg );
}
if ( $isatty && function_exists( 'readline' ) ) {
- return readline( $prompt );
+ $resp = readline( $prompt );
+ if ( $resp === null ) {
+ // Workaround for https://github.com/facebook/hhvm/issues/4776
+ return false;
+ } else {
+ return $resp;
+ }
} else {
if ( $isatty ) {
$st = self::readlineEmulation( $prompt );