17int main(
int argc,
char** argv) {
19 std::cerr <<
"usage: nanommo_graph <content folder> <graph folder>\n";
22 const absl::StatusOr<nanommo::Content> content =
25 std::cerr <<
"nanommo_graph: " << content.status().message() <<
'\n';
28 smollergraph::Graph graph;
29 absl::Status status = graph.Open(argv[2]);
32 std::cerr <<
"nanommo_graph: " << status.message() <<
'\n';
35 std::cout << graph.node_count() <<
" nodes, " << graph.relationship_count()
36 <<
" relationships\n";
38 const absl::StatusOr<std::vector<std::string>> cycles =
40 if (!lines.ok() || !cycles.ok()) {
41 std::cerr <<
"nanommo_graph: "
42 << (lines.ok() ? cycles.status() : lines.status()).message()
46 lines->insert(lines->end(), cycles->begin(), cycles->end());
47 for (
const std::string& line : *lines) std::cout << line <<
'\n';
51 return lines->empty() ? 0 : 1;
absl::StatusOr< Content > ReadContent(const std::string &folder)
Reads each file in the folder, or says which file is wrong, and where.