When using boost::program_options
, how do I set the name of an argument for boost::program_options::value<>()
?
#include
In recent versions of Boost (only tested for >= 1.61) this is fully supported. Below a slight modification of the first example in the tutorial, where "LEVEL" is printed instead of "arg":
po::options_description desc("Allowed options");
desc.add_options()
("help", "produce help message")
("compression", po::value()->value_name("LEVEL"), "set compression level")
;
Live Example