Don't output useless new lines in main.cpp
This commit is contained in:
parent
dc21af192b
commit
429ed02483
|
@ -40,7 +40,9 @@ namespace Yerbacon {
|
||||||
[[nodiscard]] const char* what() const noexcept final {
|
[[nodiscard]] const char* what() const noexcept final {
|
||||||
return exceptionCause.data();
|
return exceptionCause.data();
|
||||||
}
|
}
|
||||||
explicit Exception(const std::string_view& cause): exceptionCause(cause) {}
|
explicit Exception(const std::string_view& cause): exceptionCause(cause) {
|
||||||
|
if (!cause.ends_with('\n')) exceptionCause += '\n';
|
||||||
|
}
|
||||||
Exception(const std::string_view& cause, unsigned long line): Exception(('L' + std::to_string(line) + ": ").append(cause)) {}
|
Exception(const std::string_view& cause, unsigned long line): Exception(('L' + std::to_string(line) + ": ").append(cause)) {}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,11 +68,10 @@ int main(int argc, char* argv[]) {
|
||||||
for_each(Units.begin(), Units.end(), [&printResult](future<pair<string, optional<Yerbacon::Exception>>>& currentFuture) {
|
for_each(Units.begin(), Units.end(), [&printResult](future<pair<string, optional<Yerbacon::Exception>>>& currentFuture) {
|
||||||
const auto&& result = currentFuture.get();
|
const auto&& result = currentFuture.get();
|
||||||
if (not result.second.has_value()) {
|
if (not result.second.has_value()) {
|
||||||
if (printResult) cout << result.first;
|
if (printResult) cout << result.first << '\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';
|
||||||
}
|
}
|
||||||
cout << "\n\n";
|
|
||||||
});
|
});
|
||||||
} else cout << "No valid file provided.\n";
|
} else cout << "No valid file provided.\n";
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
|
Loading…
Reference in New Issue