[Boost-bugs] [Boost C++ Libraries] #2982: Required Arguments

Subject: [Boost-bugs] [Boost C++ Libraries] #2982: Required Arguments
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-04-30 18:29:49


#2982: Required Arguments
------------------------------------------------+---------------------------
 Reporter: David Doria <daviddoria_at_[hidden]> | Owner: vladimir_prus
     Type: Feature Requests | Status: new
Milestone: Boost 1.39.0 | Component: program_options
  Version: Boost Development Trunk | Severity: Not Applicable
 Keywords: Required Arguments |
------------------------------------------------+---------------------------
 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);
     }

 It would be nice to do something like:
 desc.add_options()
             ("input", po::value<std::string>(&InputFile)->required(), "Set
 input file.")

 That will perform that check automatically.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2982>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:00 UTC