1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-04-19 09:02:15 +02:00

Don't parses regexes with --files.

When the --files flag is given, ripgrep would still try to parse some of
the positional arguments as regexes. Don't do that.

Fixes #326
This commit is contained in:
Andrew Gallant 2017-02-18 15:34:54 -05:00
parent 16de47920c
commit 525b278049

View File

@ -434,6 +434,9 @@ impl<'a> ArgMatches<'a> {
///
/// If any pattern is invalid UTF-8, then an error is returned.
fn patterns(&self) -> Result<Vec<String>> {
if self.is_present("files") || self.is_present("type-list") {
return Ok(vec![self.empty_pattern()]);
}
let mut pats = vec![];
match self.values_of_os("regexp") {
None => {