M
MorningStar
I wrote the following simple program:
//some includes here.
int main(int argc, char* argv[]) {
options_description desc("Usage");
desc.add_options()("help", "Show this message.");
desc.add_options()("config,c", value<string>(), "Specify the
configuration file.");
variables_map vm;
store(parse_command_line(argc, argv, desc), vm);
notify(vm);
if(vm.count("help")) {
cout << desc << endl;
return 0;
}
return 0;
}
And using the "--help" command line argument, it genrated the
following program usage:
Usage:
--help Show this message.
-c [ --config ] arg Specify the configuration file.
Who knows how to turn the "arg" in the last line into something more
meaningful, say, "file"?.
In other words, how to generate the last line as:
-c [ --config ] <file> Specify the configuration file.
//some includes here.
int main(int argc, char* argv[]) {
options_description desc("Usage");
desc.add_options()("help", "Show this message.");
desc.add_options()("config,c", value<string>(), "Specify the
configuration file.");
variables_map vm;
store(parse_command_line(argc, argv, desc), vm);
notify(vm);
if(vm.count("help")) {
cout << desc << endl;
return 0;
}
return 0;
}
And using the "--help" command line argument, it genrated the
following program usage:
Usage:
--help Show this message.
-c [ --config ] arg Specify the configuration file.
Who knows how to turn the "arg" in the last line into something more
meaningful, say, "file"?.
In other words, how to generate the last line as:
-c [ --config ] <file> Specify the configuration file.