Do not output compilation results that are made of whitespace characters

This commit is contained in:
Username404-59 2021-10-08 17:45:49 +02:00
parent 2458c7bb6c
commit 1b91a2a761
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1

View File

@ -71,7 +71,11 @@ int main(int argc, char* argv[]) {
const auto&& result = currentFuture.get();
const bool is_exception = result.second.has_value();
if (not is_exception) {
if (printResult) cout << result.first << '\n';
if (printResult && !(result.first.empty() || all_of(result.first.begin(), result.first.end(), [](const char& character){
return isspace(character);
}))) {
cout << result.first << '\n';
}
} else {
cout << "Compilation of " << result.first << " has failed with the following error:\n" << result.second.value().what() << '\n';
}