the usage message generated by boost::program_options.

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.
 
M

mlimber

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.

I bet the folks on the Boost User List do (see http://boost.org/more/mailing_lists.htm#users).
Your question as stated is off-topic here (http://www.parashift.com/c+
+-faq-lite/how-to-post.html#faq-5.9).

Cheers! --M
 
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.

I bet the folks on the Boost User List do (seehttp://boost.org/more/mailing_lists.htm#users).
Your question as stated is off-topic here (http://www.parashift.com/c+
+-faq-lite/how-to-post.html#faq-5.9).

Cheers! --M- Òþ²Ø±»ÒýÓÃÎÄ×Ö -

- ÏÔʾÒýÓõÄÎÄ×Ö -

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top