Skip to content

Use Cases Requirements

Jeff Garland edited this page May 14, 2015 · 8 revisions

Basic parameters with simple option type

   options myoptions;

   option server {"server", "server host and port info", "server1:9097", 1, "s|server", "string"};option_file subconfig("subconfig", "an optional cfg file to open ",
   			              "/usr/foo.cfg",  //default for file
   				      NO_CHECK));

   option_time start( "start", query start time" , 2, boost::posix_time::ptime(), 

   int device_count = // read from elsewhere
   for (int i; i < device_count, i++)
      myoptions.add(option_range("device" + to_string(i) + "foo", "foo options for a device", 25, 2, 30));

   const string validTypes[3] = 
    { "xml", "json", "yaml" };
   enum ftype { XML, JSON, YAML };
   option_enum<ftype> file_types { "filetype", "The types of files allowed", "XML", validTypes };

Clone this wiki locally