Should check that input is a tty before refusing to read from stdin.