ripgrep: add --glob-case-insensitive

This flag forces -g/--glob patterns to be treated case-insensitively, as with
--iglob patterns.

Fixes #1293
This commit is contained in:
dana
2019-08-01 16:08:58 -05:00
committed by Andrew Gallant
parent adb9332f52
commit c2cb0a4de4
4 changed files with 36 additions and 0 deletions

View File

@@ -1268,6 +1268,10 @@ impl ArgMatches {
/// Builds the set of glob overrides from the command line flags.
fn overrides(&self) -> Result<Override> {
let mut builder = OverrideBuilder::new(env::current_dir()?);
// Make all globs case insensitive with --glob-case-insensitive.
if self.is_present("glob-case-insensitive") {
builder.case_insensitive(true).unwrap();
}
for glob in self.values_of_lossy_vec("glob") {
builder.add(&glob)?;
}