Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions josh-core/src/filter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ enum Op {
Subdir(std::path::PathBuf),
Workspace(std::path::PathBuf),

Glob(String),
Pattern(String),
Message(String),

Compose(Vec<Filter>),
Expand Down Expand Up @@ -486,7 +486,7 @@ fn spec2(op: &Op) -> String {
Op::Subdir(path) => format!(":/{}", parse::quote_if(&path.to_string_lossy())),
Op::File(path) => format!("::{}", parse::quote_if(&path.to_string_lossy())),
Op::Prefix(path) => format!(":prefix={}", parse::quote_if(&path.to_string_lossy())),
Op::Glob(pattern) => format!("::{}", parse::quote_if(pattern)),
Op::Pattern(pattern) => format!("::{}", parse::quote_if(pattern)),
Op::Author(author, email) => {
format!(":author={};{}", parse::quote(author), parse::quote(email))
}
Expand Down Expand Up @@ -1011,7 +1011,7 @@ fn apply2<'a>(
Ok(t)
}

Op::Glob(pattern) => {
Op::Pattern(pattern) => {
let pattern = glob::Pattern::new(pattern)?;
let options = glob::MatchOptions {
case_sensitive: true,
Expand Down
2 changes: 1 addition & 1 deletion josh-core/src/filter/opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ pub fn invert(filter: Filter) -> JoshResult<Filter> {
Op::Subdir(path) => Some(Op::Prefix(path)),
Op::File(path) => Some(Op::File(path)),
Op::Prefix(path) => Some(Op::Subdir(path)),
Op::Glob(pattern) => Some(Op::Glob(pattern)),
Op::Pattern(pattern) => Some(Op::Pattern(pattern)),
Op::Rev(_) => Some(Op::Nop),
Op::RegexReplace(_) => Some(Op::Nop),
_ => None,
Expand Down
2 changes: 1 addition & 1 deletion josh-core/src/filter/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fn parse_item(pair: pest::iterators::Pair<Rule>) -> JoshResult<Op> {
to_filter(make_op(&["prefix", arg])?),
))
} else if arg.contains('*') {
Ok(Op::Glob(arg.to_string()))
Ok(Op::Pattern(arg.to_string()))
} else {
Ok(Op::File(Path::new(arg).to_owned()))
}
Expand Down