Added --input and --output options to optionally replace stdin and stdout