Add option -f for outputting to a file instead of stdout.