| 107 | }; |
| 108 | |
| 109 | int main(int argc, char **argv) { |
| 110 | std::string address("amqp://127.0.0.1:5672/examples"); |
| 111 | example::options opts(argc, argv); |
| 112 | |
| 113 | opts.add_value(address, 'a', "address", "listen on URL", "URL"); |
| 114 | |
| 115 | try { |
| 116 | opts.parse(); |
| 117 | |
| 118 | server srv(address); |
| 119 | proton::container(srv).run(); |
| 120 | |
| 121 | return 0; |
| 122 | } catch (const example::bad_option& e) { |
| 123 | std::cout << opts << std::endl << e.what() << std::endl; |
| 124 | } catch (const std::exception& e) { |
| 125 | std::cerr << e.what() << std::endl; |
| 126 | } |
| 127 | |
| 128 | return 1; |
| 129 | } |