summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2007-01-31 16:52:33 +0000
committerIulian Dragos <jaguarul@gmail.com>2007-01-31 16:52:33 +0000
commitd69bbfb0318d30465bda6e83f77936d2a3ce694b (patch)
treeb9f4992eeead572066e479cb5098ad12d41324ac
parent47fd02fe687c9ed19f82baf6322ef0b3ff8455c2 (diff)
downloadscala-d69bbfb0318d30465bda6e83f77936d2a3ce694b.tar.gz
scala-d69bbfb0318d30465bda6e83f77936d2a3ce694b.tar.bz2
scala-d69bbfb0318d30465bda6e83f77936d2a3ce694b.zip
Fixed some bugs, added test case for Console
-rw-r--r--src/library/scala/Console.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/library/scala/Console.scala b/src/library/scala/Console.scala
index ff1f0ce392..553dda9860 100644
--- a/src/library/scala/Console.scala
+++ b/src/library/scala/Console.scala
@@ -196,6 +196,18 @@ object Console {
*/
def readLine: String = in.readLine()
+ /** Print a formatted text and read a full line from the terminal
+ *
+ * @param text the format of the text to print out.
+ * @param args the parameters used to instantiate the format.
+ * @return the string read from the terminal.
+ */
+ def readLine(text: String, args: Any*): String = {
+ format(text, args: _*)
+ in.readLine()
+ }
+
+
/** Read a boolean value from the terminal.
*
* @return the boolean value read from the terminal.