lemon/arg_parser.cc
changeset 1208 c6aa2cc1af04
parent 877 141f9c0db4a3
equal deleted inserted replaced
10:22a4c1add208 11:0e69128a5ee1
   219 
   219 
   220   ArgParser &ArgParser::synonym(const std::string &syn,
   220   ArgParser &ArgParser::synonym(const std::string &syn,
   221                                 const std::string &opt)
   221                                 const std::string &opt)
   222   {
   222   {
   223     Opts::iterator o = _opts.find(opt);
   223     Opts::iterator o = _opts.find(opt);
   224     Opts::iterator s = _opts.find(syn);
       
   225     LEMON_ASSERT(o!=_opts.end(), "Unknown option: '"+opt+"'");
   224     LEMON_ASSERT(o!=_opts.end(), "Unknown option: '"+opt+"'");
   226     LEMON_ASSERT(s==_opts.end(), "Option already used: '"+syn+"'");
   225     LEMON_ASSERT(_opts.find(syn)==_opts.end(),
       
   226                  "Option already used: '"+syn+"'");
   227     ParData p;
   227     ParData p;
   228     p.help=opt;
   228     p.help=opt;
   229     p.mandatory=false;
   229     p.mandatory=false;
   230     p.syn=true;
   230     p.syn=true;
   231     _opts[syn]=p;
   231     _opts[syn]=p;