lemon/arg_parser.cc
changeset 213 56579d12575b
parent 209 765619b7cbb2
child 214 60eecd3fe37a
equal deleted inserted replaced
4:dc409a17e6de 5:8da87a349b6a
   393           int set=0;
   393           int set=0;
   394           for(GroupData::Opts::iterator o=i->second.opts.begin();
   394           for(GroupData::Opts::iterator o=i->second.opts.begin();
   395               o!=i->second.opts.end();++o)
   395               o!=i->second.opts.end();++o)
   396             if(_opts.find(*o)->second.set) ++set;
   396             if(_opts.find(*o)->second.set) ++set;
   397           if(i->second.mandatory&&!set) {
   397           if(i->second.mandatory&&!set) {
   398             std::cerr << _command_name
   398             std::cerr << _command_name <<
   399                       << ": At least one of the following arguments is mandatory.\n";
   399               ": At least one of the following arguments is mandatory.\n";
   400             ok=false;
   400             ok=false;
   401             for(GroupData::Opts::iterator o=i->second.opts.begin();
   401             for(GroupData::Opts::iterator o=i->second.opts.begin();
   402                 o!=i->second.opts.end();++o)
   402                 o!=i->second.opts.end();++o)
   403               showHelp(_opts.find(*o));
   403               showHelp(_opts.find(*o));
   404           }
   404           }
   405           if(i->second.only_one&&set>1) {
   405           if(i->second.only_one&&set>1) {
   406             std::cerr << _command_name
   406             std::cerr << _command_name <<
   407                       << ": At most one of the following arguments can be given.\n";
   407               ": At most one of the following arguments can be given.\n";
   408             ok=false;
   408             ok=false;
   409             for(GroupData::Opts::iterator o=i->second.opts.begin();
   409             for(GroupData::Opts::iterator o=i->second.opts.begin();
   410                 o!=i->second.opts.end();++o)
   410                 o!=i->second.opts.end();++o)
   411               showHelp(_opts.find(*o));
   411               showHelp(_opts.find(*o));
   412           }
   412           }