mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:18:13 +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 };
|
bool print_filename { files.size() > 1 };
|
||||||
for (auto& filename : files) {
|
for (auto& filename : files) {
|
||||||
auto result = handle_file(filename, print_filename);
|
auto result = handle_file(filename, print_filename);
|
||||||
if (result.is_error()) {
|
if (result.is_error() && !suppress_errors) {
|
||||||
if (!suppress_errors)
|
warnln("Failed with file {}: {}", filename, result.release_error());
|
||||||
warnln("Failed with file {}: {}", filename, result.release_error());
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue