- po::options_description desc("Allowed options");
- desc.add_options()
- ("help", "produce help message")
- ("duration", po::value<int>(),
- "number of seconds for server to exist")
- ("port", po::value< std::vector<std::string> >(), "listener port")
- ;
-
- po::positional_options_description p;
- p.add("port", -1);
-
- po::variables_map vm;
- po::store(po::command_line_parser(argc, argv).
- options(desc).positional(p).run(), vm);
- po::notify(vm);
-
- if (vm.count("help")) {
- std::cout << desc << "\n";
- return 1;
- }