Skip to content

Conversation

@Beagle
Copy link

@Beagle Beagle commented Aug 1, 2015

By using grep's built-in options -I and -d, one can achieve the same goals as are achieved by conditionals and tests in the current code. This eliminates the need for an entire module ("path") and reduces code complexity.

Instead of using a pipe-delimited string and injecting it directly, it is safer and easier for future developers to manipulate a native array of patterns and compose the ORed set using Array.join("|").

Because hardcoded paths were used in multiple locations, DRY (and an aversion to magic values) drive me to create variables for them instead.

Beagle added 4 commits August 1, 2015 00:33
This reverts commit 8731c51. From man grep(1): -I Process a binary file as if it did not contain matching data; this is equivalent to the --binary-files=without-match
From man grep(1): -d ACTION, --directories=ACTION If an input file is a directory, use ACTION to process it. By default, ACTION is read, i.e., read directories just as if they were ordinary files. If ACTION is skip, silently skip directories. If ACTION is recurse, read all files under each directory, recursively, following symbolic links only if they are on the command line. This is equivalent to the -r option.
@jpignata
Copy link
Contributor

Closing due to staleness.

@jpignata jpignata closed this Dec 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants