Lightweight C++ command-line option parser library for developers
Lightweight C++ command-line option parser
cxxopts$ #include <cxxopts.hpp>
cxxopts::Options options("program", "Description");
options.add_options()("h,help", "Print help");$ cxxopts::Options opts("myapp"); opts.add_options()("f,file", "Input file", cxxopts::value<std::string>()); auto result = opts.parse(argc, argv);$ if(result.count("help")) { std::cout << opts.help() << std::endl; } std::string file = result["file"].as<std::string>();