prompt

public func prompt(String) -> Result[String, IoError]

Writes message to stdout, flushes, then reads a line from stdin. The flush matters for line-buffered terminals — without it the prompt would appear after the user's keystrokes.

Examples

let name = try prompt("Name: "); try println("Hello, " + name);

Defined in lang/std/io/stdio.ks