Add --invert to filter/match

Like `grep -v`/`string match -v`.
This commit is contained in:
Fabian Homborg
2021-09-03 16:28:44 +02:00
parent f6fb347d98
commit 3a9c52cefa
2 changed files with 23 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ Synopsis
path base [(-z | --null-in)] [(-Z | --null-out)] [(-q | --quiet)] [PATH...]
path dir [(-z | --null-in)] [(-Z | --null-out)] [(-q | --quiet)] [PATH...]
path extension [(-z | --null-in)] [(-Z | --null-out)] [(-q | --quiet)] [PATH...]
path filter [(-z | --null-in)] [(-Z | --null-out)] [(-q | --quiet)] [(-t | --type) TYPE] [(-p | --perm) PERMISSION] [PATH...]
path filter [(-z | --null-in)] [(-Z | --null-out)] [(-v | --invert)] [(-q | --quiet)] [(-t | --type) TYPE] [(-p | --perm) PERMISSION] [PATH...]
path normalize [(-z | --null-in)] [(-Z | --null-out)] [(-q | --quiet)] [PATH...]
path real [(-z | --null-in)] [(-Z | --null-out)] [(-q | --quiet)] [PATH...]
path strip-extension [(-z | --null-in)] [(-Z | --null-out)] [(-q | --quiet)] [PATH...]
@@ -139,6 +139,8 @@ Note that the path needs to be *any* of the given types, but have *all* of the g
And if your operating system doesn't support a "sticky" bit, checking for it will always be false, so no path will pass.
With ``--invert``, the meaning of the filtering is inverted - any path that wouldn't pass (including by not existing) passes, and any path that would pass fails.
It returns 0 if at least one path passed the filter.
Examples