Fixed directory regex in command line parsing

Regex was incorrect in command line parsing and was truncating
paths with non characters
Simplified regex to just get rid of trailing slashes, check_dir
should handle invalid entries without cleaning up further
Fixed command line ignoring of directories

Only files were being checked against the ignore list
Added proper check for directories against ignore list to resolve issue