I wrote the following simple program:
//some includes here.
int main(int argc, char* argv[]) {
options_descrip tion desc("Usage");
desc.add_option s()("help", "Show this message.");
desc.add_option s()("config,c", value<string>() , "Specify the
configuration file.");
variables_map vm;
store(parse_com mand_line(argc, argv, desc), vm);
notify(vm);
if(vm.count("he lp")) {
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 ] <fileSpecify the configuration file. 2 3050
On Mar 22, 9:32 am, "MorningSta r" <steedho...@163 .netwrote:
I wrote the following simple program:
//some includes here.
int main(int argc, char* argv[]) {
options_descrip tion desc("Usage");
desc.add_option s()("help", "Show this message.");
desc.add_option s()("config,c", value<string>() , "Specify the
configuration file.");
variables_map vm;
store(parse_com mand_line(argc, argv, desc), vm);
notify(vm);
if(vm.count("he lp")) {
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 ] <fileSpecify 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
On 3ÔÂ22ÈÕ, ÏÂÎç10ʱ07·Ö, "mlimber" <mlim...@gmail. comwrote:
On Mar 22, 9:32 am, "MorningSta r" <steedho...@163 .netwrote:
I wrote the following simple program:
//some includes here.
int main(int argc, char* argv[]) {
options_descrip tion desc("Usage");
desc.add_option s()("help", "Show this message.");
desc.add_option s()("config,c", value<string>() , "Specify the
configuration file.");
variables_map vm;
store(parse_com mand_line(argc, argv, desc), vm);
notify(vm);
if(vm.count("he lp")) {
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 ] <fileSpecify the configuration file.
I bet the folks on the Boost User List do (seehttp://boost.org/more/mailing_lists.h tm#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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: SnaiL |
last post by:
I've try to compile simple program which uses boost::program_options
and got error like this:
LINK : fatal error LNK1104: cannot open file
'libboost_program_options-vc7-mt-s-1_32.lib'
I was suprised, because always think that boost doesn't require any
library, it uses templates, doesn't it?
Maybe it is program_options error? Please help.
|
by: Jeff Flinn |
last post by:
At the risk of raising the OT ire of some here, I'd like to know what might
be done to raise the awareness of the boost libraries.
I've found boost and it's libraries invaluable in my work for ~5 years now.
The first two postings in this group this morning are addressed almost
trivially by using libraries from www.boost.org. IMO, the functionality in
boost increases the usability of C++ at least as much as the standard
library does.
...
|
by: Hardy |
last post by:
Hi, just come into the boost world. just the first.cpp in the
program_options examples, with many link error...
devc++4.9.9.2, gcc 3.4.2,
can I get your opinions on this problem? thank you~
make.exe -f "D:\temp\Makefile.win" all
g++.exe -c main.cpp
-o
|
by: Starfox |
last post by:
The Following Code:
//Setup the options
string InputName, OutputSkeletonName, OutputModelName;
program_options::options_description OptionDesc("Available Options");
OptionDesc.add_options()
("help", "produce help message")
("input,I", program_options::value<string>(&InputName), "Input
md5mesh File")
("out-skl,S", program_options::value<string>(&OutputSkeletonName),
|
by: Krivenok Dmitry |
last post by:
I use boost program_options library in my project.
But I have one trouble and can't solve it :(
I writing simple wrapper class and use generic selector:
///////////////////////////////////////////////////////////////////
// General options selector
template <class T>
void CmdLine::GetOption(const std::string& Name, T& var)
{
if (VariablesMap_.count(Name)) var = VariablesMap_.as<T>();
| |
by: p_kolya |
last post by:
Hello!
I'am build boost 1.32, but some libraries (program_options for example)
didn't compile because of errors. For example file:
boost\program_options\detail\utf8_codecvt_facet.hpp can't be compiled
:(
I'm use:
boost 1.32
STLPort 4.6.2
Visual C++ 7.1
WinXP SP2 Prof
|
by: cesco |
last post by:
Hi,
I'm using the boost library program_options for parsing the command
line given to my program as described in the class Parameter:
// Main.cpp
#include "Parameter.h"
using namespace std;
int main(int ac, char* av)
|
by: pallav |
last post by:
i'm using the boost:rogram_options and i'm having some problems with
syntax: the code in question is the following:
vector<stringopt;
po:ptions_description desc("Usage");
desc.add_options()
("nodes,n", po::value<vector<string (&opt)->default_value("*"),
"Name of node(s) to print.")
;
|
by: zade |
last post by:
Hi all
boost::program_options needs be builled into libraries, static or
dynamic. I use MSVC7.1 to build the boost::program_options for my
project .In my .cpp file , I write:
namespace po = boost::program_options;
struct CommandLineParser
{
CommandLineParser()
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |