From 7e8c2248d0e111f9f0242a2f151870cf3e1f8e69 Mon Sep 17 00:00:00 2001 From: Pramod Bisht Date: Sun, 18 Feb 2018 22:20:53 +0530 Subject: [PATCH] Fixes: #234 Giving suggestion to use `--fixed-strings` in case user passes invalid metacharacters as a regex. --- src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index bff1766..f4b558b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -182,6 +182,12 @@ fn main() { .build() { Ok(re) => walk::scan(&dir_vec, Arc::new(re), Arc::new(config)), - Err(err) => error(err.description()), + Err(err) => error( + format!( + "{}\nHint: You can use the '--fixed-strings' option to search for a \ + literal string instead of a regular expression", + err.description() + ).as_str(), + ), } }