harrah/xsbt — pull request #223 by softprops (2011-10-13 06:23:44+00:00)
Title: add support for a masked readline

Hey. I had the need in the heroku plugin to use jlines masked readline support so I added it to your JLine interface's `readLine` method as an optional char defaulting to None so it requires no code changes.

Example usage in a build file

TaskKey[Unit]("prompt-in-plain-sight") <<= (streams) map {
(out) => out.log.info(
SimpleReader.readLine("What is your fav color? ").get
)
}

TaskKey[Unit]("prompt-discreetly") <<= (streams) map {
(out) => out.log.info(
SimpleReader.readLine("What is your bank account number? ", Some('*')).get
)
}

Session

> sbt-version
[info] 0.11.1-SNAPSHOT
> prompt-in-plain-sight
What is your fav color? green
[info] green
[success] Total time: 13 s, completed Oct 13, 2011 2:10:36 AM
> prompt-discreetly
What is your bank account number? **********
[info] ican'tsay!
[success] Total time: 28 s, completed Oct 13, 2011 2:11:12 AM

People can continue using it as it was, but can add a masking char if they are paranoid about the guy looking over their shoulder as they type.

What do you think?