mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:14:58 +00:00
grep: Don't end the program early after failing to grep a file
We should still try to read remaining files.
This commit is contained in:
parent
94eb31865a
commit
5a85449b23
1 changed files with 2 additions and 4 deletions
|
@ -281,10 +281,8 @@ ErrorOr<int> serenity_main(Main::Arguments args)
|
|||
bool print_filename { files.size() > 1 };
|
||||
for (auto& filename : files) {
|
||||
auto result = handle_file(filename, print_filename);
|
||||
if (result.is_error()) {
|
||||
if (!suppress_errors)
|
||||
warnln("Failed with file {}: {}", filename, result.release_error());
|
||||
return 1;
|
||||
if (result.is_error() && !suppress_errors) {
|
||||
warnln("Failed with file {}: {}", filename, result.release_error());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue