Changeset 1485


Ignore:
Timestamp:
08/10/08 16:47:20 (6 years ago)
Author:
wehart
Message:

A utility for handling command-line arguments in a simpler manner
than is provided by the UTILIB ParameterSet? class. This is not meant to
supplant the ParameterSet? functionality, since that is used in more complex
circumstances. Instead, this makes it easy to setup and used command-line
options in a standard way.

There remain several things that need to be done:

  • unit tests
  • Fix processing logic
  • Enable wrapping of description text.
Location:
utilib/trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • utilib/trunk/src/headers/Makefile.am

    r1445 r1485  
    9999  $(srcdir)/../io/utilib/Parameter.h\ 
    100100  $(srcdir)/../io/utilib/ParameterSet.h\ 
     101  $(srcdir)/../io/utilib/OptionParser.h\ 
    101102  $(srcdir)/../io/utilib/mpiUtil.h\ 
    102103  $(srcdir)/../io/utilib/comments.h\ 
  • utilib/trunk/src/io/utilib/ParameterSet.h

    r1420 r1485  
    256256  void augment_parameters(ParameterSet& pset, bool overwrite=false); 
    257257 
     258  /// 
     259  const Parameter& get_raw_info(const std::string& param) 
     260        { return find_parameter(param); } 
     261 
     262  /// 
     263  const Parameter& get_raw_info(const std::string& param) const 
     264        { return find_parameter(param); } 
     265 
    258266protected: 
    259267 
  • utilib/trunk/test/Makefile.am

    r1461 r1485  
    7272        exception_test.cpp \ 
    7373        class_options.cpp \ 
     74        option_parser.cpp \ 
    7475        sharedval.cpp \ 
    7576        any.cpp \ 
  • utilib/trunk/test/tests.cpp

    r1445 r1485  
    2828   int test_namespace(int argc, char** argv); 
    2929   int test_olist(int argc, char** argv); 
     30   int test_option_parser(int argc, char** argv); 
    3031   int test_packbuf(int argc, char** argv); 
    3132   int test_paramtest(int argc, char** argv); 
     
    140141   status = test_olist(argc,argv); 
    141142 
     143if (!tmp || (strcmp(tmp,"option_parser") == 0)) 
     144   status = test_option_parser(argc,argv); 
     145 
    142146if (!tmp || (strcmp(tmp,"packbuf") == 0)) 
    143147   status = test_packbuf(argc,argv); 
Note: See TracChangeset for help on using the changeset viewer.