Change auto op for FEKs to glob
This commit is contained in:
parent
ba9d9939d9
commit
159a8a4b2e
|
@ -93,16 +93,15 @@ impl FromStr for Filter {
|
|||
on: m,
|
||||
op: match o {
|
||||
Op::Auto => match m {
|
||||
Matcher::Path => Op::Glob,
|
||||
Matcher::Path | Matcher::FileEventKind => Op::Glob,
|
||||
_ => Op::InSet,
|
||||
},
|
||||
o => o,
|
||||
},
|
||||
pat: match (o, m) {
|
||||
// TODO: carry regex/glob errors through
|
||||
(Op::Auto | Op::Glob, Matcher::Path) | (Op::Glob | Op::NotGlob, _) => {
|
||||
Pattern::Glob(p.to_string())
|
||||
}
|
||||
(Op::Auto, Matcher::Path | Matcher::FileEventKind)
|
||||
| (Op::Glob | Op::NotGlob, _) => Pattern::Glob(p.to_string()),
|
||||
(Op::Auto | Op::InSet | Op::NotInSet, _) => {
|
||||
Pattern::Set(p.split(',').map(|s| s.trim().to_string()).collect())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue