Quit the program on end-of-file

Check for EOF when reading the command line. Quit the program if we
detect it.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>