Added getopt functionality to work with entire directories or single files in other directories