#include "cloud_point_rpc/cli.hpp" #include "cloud_point_rpc/config.hpp" #include #include #include int main(int argc, char *argv[]) { google::InitGoogleLogging(argv[0]); FLAGS_logtostderr = 1; std::string config_path = "config.yaml"; if (argc > 1) { config_path = argv[1]; } // Check if config file exists std::ifstream f(config_path.c_str()); if (!f.good()) { std::cerr << "Config file not found: " << config_path << std::endl; std::cerr << "Please create config.yaml or provide path as argument." << std::endl; return 1; } f.close(); try { auto config = cloud_point_rpc::ConfigLoader::load(config_path); return cloud_point_rpc::run_cli(std::cin, std::cout, config.server.ip, config.server.port); } catch (const std::exception &e) { std::cerr << "Failed to start CLI: " << e.what() << std::endl; return 1; } }