Prevent the compilation output from being printed when printResult is false

This commit is contained in:
Username404-59 2021-08-20 01:34:29 +02:00
parent 729e04161f
commit 845794a922
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 3 additions and 4 deletions

View File

@ -69,13 +69,12 @@ int main(int argc, char* argv[]) {
for (auto& currentFuture: Units) { for (auto& currentFuture: Units) {
const auto&& result = currentFuture.get(); const auto&& result = currentFuture.get();
if (not result.second.has_value()) { if (not result.second.has_value()) {
cout << result.first; If (printResult) cout << result.first << "\n\n";
} else { } else {
cout << "Compilation of " << result.first << " has failed with the following error:\n" << result.second.value().what(); cout << "Compilation of " << result.first << " has failed with the following error:\n" << result.second.value().what() << "\n\n";
} }
cout << "\n\n";
} }
} else cout << "No valid file provided.\n"; } else cout << "No valid file provided.\n";
} }
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }