Boost logo

Boost Users :

Subject: Re: [Boost-users] Program options required arguments?
From: Vladimir Prus (vladimir_at_[hidden])
Date: 2009-04-30 14:19:12


David Doria wrote:

> If I have a list of 10 parameters, and all are required,
>
> I end up with a giant block of these:
>
> if(!vm.count("input"))
> {
> std::cout << "Input was not set." << std::endl;
> exit(-1);
> }
>
> Is there a way to do something like:
> desc.add_options()
> ("input", po::value<std::string>(&InputFile)->required(), "Set
> input file.")
>
> That will perform that check for me?

Not at the moment. Feel free to file a request at svn.boost.org

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net