Added --output option to write output to a file (without having to use redirection)