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:
parent
16de47920c
commit
525b278049
@ -434,6 +434,9 @@ impl<'a> ArgMatches<'a> {
|
|||||||
///
|
///
|
||||||
/// If any pattern is invalid UTF-8, then an error is returned.
|
/// If any pattern is invalid UTF-8, then an error is returned.
|
||||||
fn patterns(&self) -> Result<Vec<String>> {
|
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![];
|
let mut pats = vec![];
|
||||||
match self.values_of_os("regexp") {
|
match self.values_of_os("regexp") {
|
||||||
None => {
|
None => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user