rdstdin

This module contains code for reading from stdin. On UNIX the linenoise library is wrapped and set up to provide default key bindings (e.g. you can navigate with the arrow keys). On Windows system.readLine is used. This suffices because Windows' console already provides the wanted functionality.

Examples:

echo readLineFromStdin("Is Nim awesome? (Y/n):")
var userResponse: string
doAssert readLineFromStdin("How are you?:", line = userResponse)
echo userResponse

Procs

proc readLineFromStdin(prompt: string): TaintedString {...}{.
    tags: [ReadIOEffect, WriteIOEffect], raises: [IOError].}
  Source Edit
proc readLineFromStdin(prompt: string; line: var TaintedString): bool {...}{.
    tags: [ReadIOEffect, WriteIOEffect], raises: [].}
  Source Edit