Extend to allow reading from stdin rather than a file (using the - filename convention for stdin)