Added support to process a single file or a directory of files