Prompt the user to pick between in an option list between choices of type T.
Prompt the user to pick between in an option list between choices of type T. The T returned is the value the user picked.
scala> GenTask.ask("Launch the nukes?", Map(true -> List("yes", "doit"), false -> List("no", "plz no"))) Launch the nukes? [0] yes [1] no: 0 res1: Boolean = true scala> GenTask.ask("Launch the nukes?", Map(true -> List("yes", "doit"), false -> List("no", "plz no"))) Launch the nukes? [0] yes [1] no: plz no res2: Boolean = false
The type of values to pick
The question to ask the user
A map, mapping each T to a list of strings that the user could use to pick this option. The first string is special, as it is displayed to the user
Which value the user picked