#include namespace po = boost::program_options; #include using std::string; #include using std::cout; int main (int const argc, char const * const * const argv) { po::options_description opts{"Options"}; opts.add_options() ("long-option-with-arg,l", po::value(), "this is rendered in the same line by help2man") ("help,h", "print this help message") ("version,V", "print version information") ; po::variables_map config; store(parse_command_line(argc, argv, opts), config); notify(config); if (config.count("help")) { cout << "Usage: potest [ OPTIONS ]\n"; cout << opts; return {}; } if (config.count("version")) { cout << "potest 0\n"; return {}; } }