FACT++  1.0
void Configuration::PrintParsed ( const po::parsed_options &  parsed) const
private

Print all options from a list of already parsed options.

Definition at line 508 of file Configuration.cc.

References i, if(), and Max().

Referenced by Max(), and Parse().

509 {
510  const vector< po::basic_option<char> >& options = parsed.options;
511 
512  // .description -> Pointer to opt_commandline
513  // const std::vector< shared_ptr<option_description> >& options() const;
514 
515  //const std::string& key(const std::string& option) const;
516  //const std::string& long_name() const;
517  //const std::string& description() const;
518  //shared_ptr<const value_semantic> semantic() const;
519 
520  int maxlen = 0;
521  for (unsigned i=0; i<options.size(); ++i)
522  {
523  const po::basic_option<char> &opt = options[i];
524 
525  if (opt.value.size()>0 && opt.string_key[0]!='-')
526  Max(maxlen, opt.string_key.length());
527  }
528 
529  cout.setf(ios_base::left);
530 
531  // =============> Implement printing of parsed options
532  for(unsigned i=0; i<options.size(); ++i)
533  {
534  const po::basic_option<char> &opt = options[i];
535 
536  if (opt.value.size()==0 && opt.string_key[0]!='-')
537  cout << "--";
538  cout << setw(maxlen) << opt.string_key;
539  if (opt.value.size()>0)
540  cout << " = " << opt.value[0];
541 
542  //for (int j=0; j<options[i].value.size(); j++)
543  // cout << "\t = " << options[i].value[j];
544  //cout << "/" << options[i].original_tokens[0];
545 
546  ostringstream com;
547 
548  if (opt.position_key>=0)
549  com << " [position=" << opt.position_key << "]";
550  if (opt.unregistered)
551  com << " [unregistered]";
552 
553  if (!com.str().empty())
554  cout << " # " << com.str();
555 
556  cout << endl;
557  }
558 }
int i
Definition: db_dim_client.c:21
static void Max(int &val, const int &comp)
Helper function which return the max of the two arguments in the first argument.
Definition: Configuration.h:55
if(extraDns) new Dns

+ Here is the call graph for this function:

+ Here is the caller graph for this function: