osb/source/utility/dump_versioned_json.cpp

21 lines
523 B
C++
Raw Normal View History

2023-06-20 04:33:09 +00:00
#include "StarFile.hpp"
#include "StarVersioningDatabase.hpp"
using namespace Star;
int main(int argc, char** argv) {
try {
if (argc != 3) {
2023-06-27 10:23:44 +00:00
coutf("Usage, {} <versioned_json_binary> <versioned_json_json>\n", argv[0]);
2023-06-20 04:33:09 +00:00
return -1;
}
auto versionedJson = VersionedJson::readFile(argv[1]);
File::writeFile(versionedJson.toJson().printJson(2), argv[2]);
return 0;
} catch (std::exception const& e) {
2023-06-27 10:23:44 +00:00
coutf("Error! Caught exception {}\n", outputException(e, true));
2023-06-20 04:33:09 +00:00
return 1;
}
}