| 80 | }; |
| 81 | |
| 82 | int main(int argc, char **argv) { |
| 83 | std::string url("127.0.0.1:5672/examples"); |
| 84 | example::options opts(argc, argv); |
| 85 | |
| 86 | opts.add_value(url, 'a', "address", "connect and send to URL", "URL"); |
| 87 | |
| 88 | try { |
| 89 | opts.parse(); |
| 90 | |
| 91 | std::vector<std::string> requests; |
| 92 | requests.push_back("Twas brillig, and the slithy toves"); |
| 93 | requests.push_back("Did gire and gymble in the wabe."); |
| 94 | requests.push_back("All mimsy were the borogroves,"); |
| 95 | requests.push_back("And the mome raths outgrabe."); |
| 96 | |
| 97 | client c(url, requests); |
| 98 | proton::container(c).run(); |
| 99 | |
| 100 | return 0; |
| 101 | } catch (const example::bad_option& e) { |
| 102 | std::cout << opts << std::endl << e.what() << std::endl; |
| 103 | } catch (const std::exception& e) { |
| 104 | std::cerr << e.what() << std::endl; |
| 105 | } |
| 106 | |
| 107 | return 1; |
| 108 | } |