Repository: BurntSushi/ripgrep
File: src/args.rs (Rust)

Code before:
    /// flags, then an error is returned.
    fn grep(&self) -> Result<Grep> {
        let smart =
            self.is_present("smart-case")
            && !self.is_present("ignore-case")
            && !self.is_present("case-sensitive");
        let casei =
            self.is_present("ignore-case")
            && !self.is_present("case-sensitive");
        let mut gb = GrepBuilder::new(&self.pattern()?)
            .case_smart(smart)
            .case_insensitive(casei)
            .line_terminator(b'\n');

        if let Some(limit) = self.dfa_size_limit()? {
            gb = gb.dfa_size_limit(limit);
        }
        if let Some(limit) = self.regex_size_limit()? {
            gb = gb.size_limit(limit);
        }
        gb.build().map_err(From::from)
    }

    /// Builds the set of glob overrides from the command line flags.
    fn overrides(&self) -> Result<Override> {
        let mut ovr = OverrideBuilder::new(env::current_dir()?);
        for glob in self.values_of_lossy_vec("glob") {
            ovr.add(&glob)?;
        }
        // this is smelly. In the long run it might make sense
        // to change overridebuilder to be like globsetbuilder
        // but this would be a breaking change to the ignore crate
        // so it is being shelved for now...
        ovr.case_insensitive(true)?;
        for glob in self.values_of_lossy_vec("iglob") {
            ovr.add(&glob)?;
        }
        ovr.build().map_err(From::from)
    }

    /// Builds a file type matcher from the command line flags.
    fn types(&self) -> Result<Types> {
        let mut btypes = TypesBuilder::new();
        btypes.add_defaults();
        for ty in self.values_of_lossy_vec("type-clear") {
            btypes.clear(&ty);
        }
        for def in self.values_of_lossy_vec("type-add") {
            btypes.add_def(&def)?;
        }
        for ty in self.values_of_lossy_vec("type") {

Review comment (suggestion):
I think I would just write, `\n(Hint: try the --fixed-strings flag to search a literal.)`

Code after:
    /// flags, then an error is returned.
    fn grep(&self) -> Result<Grep> {
        let smart =
            self.is_present("smart-case")
            && !self.is_present("ignore-case")
            && !self.is_present("case-sensitive");
        let casei =
            self.is_present("ignore-case")
            && !self.is_present("case-sensitive");
        let mut gb = GrepBuilder::new(&self.pattern()?)
            .case_smart(smart)
            .case_insensitive(casei)
            .line_terminator(b'\n');

        if let Some(limit) = self.dfa_size_limit()? {
            gb = gb.dfa_size_limit(limit);
        }
        if let Some(limit) = self.regex_size_limit()? {
            gb = gb.size_limit(limit);
        }
        gb.build().map_err(|err| {
            match err {
                GrepError::Regex(err) => {
                  let s = format!("{}\n(Hint: Try the --fixed-strings flag \
                  to search for a literal string.)", err.to_string());
                  From::from(s)
                },
                err => From::from(err)
            }
        })
    }

    /// Builds the set of glob overrides from the command line flags.
    fn overrides(&self) -> Result<Override> {
        let mut ovr = OverrideBuilder::new(env::current_dir()?);
        for glob in self.values_of_lossy_vec("glob") {
            ovr.add(&glob)?;
        }
        // this is smelly. In the long run it might make sense
        // to change overridebuilder to be like globsetbuilder
        // but this would be a breaking change to the ignore crate
        // so it is being shelved for now...
        ovr.case_insensitive(true)?;
        for glob in self.values_of_lossy_vec("iglob") {
            ovr.add(&glob)?;
        }
        ovr.build().map_err(From::from)
    }

    /// Builds a file type matcher from the command line flags.
    fn types(&self) -> Result<Types> {