add -o / --output option to write to a file