Change process completion auto op to glob
This commit is contained in:
parent
5856f976db
commit
e7de00edfe
|
@ -70,7 +70,7 @@ pub mod swaplock;
|
|||
/// | [Source](Matcher::Source) | `:=` (in set) |
|
||||
/// | [Process](Matcher::Process) | `:=` (in set) |
|
||||
/// | [Signal](Matcher::Signal) | `:=` (in set) |
|
||||
/// | [ProcessCompletion](Matcher::ProcessCompletion) | `:=` (in set) |
|
||||
/// | [ProcessCompletion](Matcher::ProcessCompletion) | `*=` (glob) |
|
||||
///
|
||||
/// [Matchers][Matcher] correspond to Tags, but are not one-to-one: the `path` matcher operates on
|
||||
/// the `path` part of the `Path` tag, and the `type` matcher operates on the `file_type`, for
|
||||
|
|
|
@ -94,14 +94,19 @@ impl FromStr for Filter {
|
|||
on: m,
|
||||
op: match o {
|
||||
Op::Auto => match m {
|
||||
Matcher::Path | Matcher::FileEventKind => Op::Glob,
|
||||
Matcher::Path
|
||||
| Matcher::FileEventKind
|
||||
| Matcher::ProcessCompletion => Op::Glob,
|
||||
_ => Op::InSet,
|
||||
},
|
||||
o => o,
|
||||
},
|
||||
pat: match (o, m) {
|
||||
// TODO: carry regex/glob errors through
|
||||
(Op::Auto, Matcher::Path | Matcher::FileEventKind)
|
||||
(
|
||||
Op::Auto,
|
||||
Matcher::Path | Matcher::FileEventKind | Matcher::ProcessCompletion,
|
||||
)
|
||||
| (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