diff --git a/bant/frontend/parsed-project.cc b/bant/frontend/parsed-project.cc index 4d974ff..134d514 100644 --- a/bant/frontend/parsed-project.cc +++ b/bant/frontend/parsed-project.cc @@ -242,8 +242,9 @@ void PrintProject(Session &session, const BazelPattern &pattern, std::unique_ptr regex; if (!flags.grep_regex.empty()) { - // TODO: pass options to not log error - regex = std::make_unique(flags.grep_regex); + RE2::Options options; + options.set_log_errors(false); // We print them ourselves + regex = std::make_unique(flags.grep_regex, options); if (!regex->ok()) { // This really needs the session passed in so that we can reach the // correct error stream.