adding an option --output_dir to output all files to a specified directory