Print matches while still searching.
continuous-integration/drone/push Build is passing Details

Previously we printed the matches at the end.
This commit is contained in:
tastytea 2021-05-28 17:18:34 +02:00
parent 59759b5934
commit 4df7b36dfc
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 8 additions and 0 deletions

View File

@ -204,6 +204,14 @@ int main(int argc, char *argv[])
}
futurepool.emplace_back(
std::async(std::launch::async, search_file, filepath));
if (!matches_all.empty())
{
output::print_matches(matches_all[0], opts,
input_files.size() == 1);
std::lock_guard<std::mutex> guard(mutex_matches_all);
matches_all.erase(matches_all.begin());
}
}
futures_cleanup(true);