]> git.proxmox.com Git - pathpatterns.git/commit
Add MatchEntry::parse_pattern
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 28 Apr 2020 10:43:46 +0000 (12:43 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 28 Apr 2020 11:25:16 +0000 (13:25 +0200)
commite2255d72d1c3dad4b407cf07eeb6ac88fb29b329
tree827d781f912cd46b0e430d249f138305af64d4ce
parentb1a53659119e6116acda7daa873eb6ff7412edcc
Add MatchEntry::parse_pattern

This is a convenience helper to parse an entry with possible
inversion via a leading exclamation mark and interpreting
trailing slashes to mean `MatchFlag::MATCH_DIRECTORY` and
create a `Pattern` from the string with those characters
stripped off.

This also changes the way `MatchFlag`s are passed to a
builder pattern for convenience.

Also: impl std::ops::Not for MatchType.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/lib.rs
src/match_list.rs