| 41 | } |
| 42 | |
| 43 | int main(int argc, char* argv[]) try { |
| 44 | auto args = ParseArguments(argc, argv); |
| 45 | if (args.project_id.empty() && args.topic_id.empty()) { |
| 46 | return 1; |
| 47 | } |
| 48 | std::cout << "Using project `" << args.project_id << "` and topic `" |
| 49 | << args.topic_id << "`\n"; |
| 50 | |
| 51 | // Automatically call `Cleanup()` before returning from `main()`. |
| 52 | std::shared_ptr<void> cleanup(nullptr, [](void*) { Cleanup(); }); |
| 53 | |
| 54 | ConfigureCloudTraceTracer(args); |
| 55 | |
| 56 | auto publisher = CreatePublisher(args); |
| 57 | |
| 58 | Publish(publisher, args); |
| 59 | |
| 60 | return 0; |
| 61 | } catch (google::cloud::Status const& status) { |
| 62 | std::cerr << "google::cloud::Status thrown: " << status << "\n"; |
| 63 | return 1; |
| 64 | } |
nothing calls this directly
no test coverage detected