/[usata]/usata2/src/options.cpp
ViewVC logotype

Diff of /usata2/src/options.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by Descender, Sun Dec 26 18:36:42 2004 UTC revision 1.4 by Descender, Sun Dec 26 22:10:19 2004 UTC
# Line 25  Line 25 
25  #include <boost/program_options.hpp>  #include <boost/program_options.hpp>
26  #include "build_info.hpp"  #include "build_info.hpp"
27    
 typedef std::pair<std::string, std::string> StringPair;  
 typedef std::vector<std::string>            StringVector;  
   
 namespace boost  
 {  
         namespace program_options  
         {  
                 void validate(boost::any& value_store,  
                                           const StringVector& values,  
                                           std::vector<StringPair> *,  
                                           int)  
                 {  
                         using namespace boost::algorithm;  
   
                         StringVector tokens;  
   
                         split(tokens, values[0], is_space());  
                         if (tokens.size() != 2)  
                                 throw validation_error("invalid string pair");  
   
                         value_store = boost::any(std::make_pair(tokens[0], tokens[1]));  
                 }  
         }  
 }  
   
28  namespace usata  namespace usata
29  {  {
30          namespace po = boost::program_options;          namespace po = boost::program_options;
# Line 73  namespace usata Line 48  namespace usata
48                          ("help,h"   , "show this help message")                          ("help,h"   , "show this help message")
49                          ("version,v", "print version")                          ("version,v", "print version")
50                          ("config,c" , po::value<std::string>(), "specify path to configuration file")                          ("config,c" , po::value<std::string>(), "specify path to configuration file")
51                          ("set,s"    , po::value<std::vector<StringPair> >()->multitoken(), "set configuration option(s)")                          ("set,s"    , po::value<std::vector<std::string> >()->multitoken(), "set configuration option(s)")
52                          ;                          ;
53    
54                  po::variables_map var_map;                  po::variables_map var_map;
# Line 123  namespace usata Line 98  namespace usata
98                  }                  }
99    
100                  return op_conf.release();                  return op_conf.release();
101          }          }
102    
103  }  } // namespace usata

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26