Convert to use argparse and work and read from stdin by default.