the_silver_searcher
the_silver_searcher copied to clipboard
Add --invert-file-search-regex flag
Just like --invert-match
can be used to find words not matching a pattern, there should a flag that acts like the inverse of --file-search-regex
, so that:
$ ag foobar --invert-file-search-regex baz
finds all files containing foobar
whose filenames do not contain baz
.
Less useful I think, but also potentially of interest, may be --invert-filename-pattern
, which would print all filenames not matching a given pattern.
Since I found this whilst looking for this capability, it's worth pointing out that --ignore
exists - see https://github.com/ggreer/the_silver_searcher/issues/1084#issuecomment-308263396 for more detail