OSDN Git Service
(root)
/
wvm
/
wvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3897aec
)
A helper method to prompt the user for some detail
author
Daniel Bachhuber
<d@danielbachhuber.com>
Mon, 19 Aug 2013 22:33:44 +0000
(15:33 -0700)
committer
Daniel Bachhuber
<d@danielbachhuber.com>
Mon, 19 Aug 2013 22:33:44 +0000
(15:33 -0700)
php/class-wp-cli.php
patch
|
blob
|
history
diff --git
a/php/class-wp-cli.php
b/php/class-wp-cli.php
index
da3a32b
..
6d907f3
100644
(file)
--- a/
php/class-wp-cli.php
+++ b/
php/class-wp-cli.php
@@
-165,6
+165,25
@@
class WP_CLI {
}
/**
+ * Prompt a user for some input
+ */
+ static function prompt( $question, $required = false ) {
+
+ do {
+
+ self::out( $question . ': ' );
+
+ $response = trim( fgets( STDIN ) );
+ if ( $required && $response )
+ $required = false;
+
+ } while( $required );
+
+ return $response;
+ }
+
+
+ /**
* Read a value, from various formats
*
* @param mixed $value