OSDN Git Service

Use `\cli\prompt()` instead of reinventing the wheel
authorDaniel Bachhuber <d@danielbachhuber.com>
Sun, 25 Aug 2013 18:24:18 +0000 (11:24 -0700)
committerDaniel Bachhuber <d@danielbachhuber.com>
Sun, 25 Aug 2013 18:24:18 +0000 (11:24 -0700)
See https://github.com/wp-cli/wp-cli/pull/673#issuecomment-22938858

php/class-wp-cli.php

index 6d907f3..db2456f 100644 (file)
@@ -171,9 +171,7 @@ class WP_CLI {
 
                do {
 
-                       self::out( $question . ': ' );
-
-                       $response = trim( fgets( STDIN ) );
+                       $response = \cli\prompt( $question );
                        if ( $required && $response )
                                $required = false;