Flags -p and -pr fails if pattern match no files

Fixes #851
Merge pull request #976 from ericmj/require

Flags -p and -pr fails if pattern match no files