06 - atomic update

This commit is contained in:
deeaitch committed 2026-10-20 12:27:04 -04:00
1 parent 6d63457737
commit 2bdacaf37a
21 files changed
+1302 -365

No files matched your search

+8 -7
View File
@@ -4,26 +4,27 @@
#include <iostream>
#include <stdexcept>
int main(int argc, char* argv[]) {
int main(int argc, char *argv[]) {
const std::string selected = argc > 1 ? argv[1] : "all";
if (argc > 2 || selected == "--help" || selected == "-h" ||
(selected != "all" && std::find(ota::scenarios().begin(), ota::scenarios().end(),
selected) == ota::scenarios().end())) {
std::ostream& output = (argc == 2 && (selected == "--help" || selected == "-h"))
? std::cout : std::cerr;
selected) == ota::scenarios().end())) {
std::ostream &output = (argc == 2 && (selected == "--help" || selected == "-h"))
? std::cout
: std::cerr;
output << "Usage: ab-simulate [all";
for (const auto& scenario : ota::scenarios()) output << '|' << scenario;
for (const auto &scenario: ota::scenarios()) output << '|' << scenario;
output << "]\n";
return &output == &std::cout ? 0 : 2;
}
try {
for (const auto& scenario : ota::scenarios()) {
for (const auto &scenario: ota::scenarios()) {
if (selected != "all" && selected != scenario) continue;
std::cout << "\n=== " << scenario << " ===\n";
ota::TemporaryDirectory directory;
ota::run_scenario(scenario, directory.path(), &std::cout);
}
} catch (const std::exception& error) {
} catch (const std::exception &error) {
std::cerr << "Simulation failed: " << error.what() << '\n';
return 1;
}