pather icon indicating copy to clipboard operation
pather copied to clipboard

Provide an `exclude` counterpart of `include` for ls.

Open BigRoy opened this issue 10 years ago • 0 comments

Goal

Currently ls offers an include argument to filter towards a subset as it queries the file system. A similar optimization could be put in place to exclude specific subsets.

Example

To exclude the 'review' family.

ls("{family}/{data}", exclude={"family": "review"})

Implementation

Unfortunately glob doesn't offer a negated pattern by default so this would mean we'd have to override glob's behavior. In short, this would mean to implement our own globbing method. Fortunately it's a relatively light-weight implementation that's easy to expand upon to add the negated behavior.

BigRoy avatar Aug 30 '15 20:08 BigRoy