delete *i;
}
+GetOpt::OptBase &GetOpt::add_option(OptBase *opt)
+{
+ for(list<OptBase *>::iterator i=opts.begin(); i!=opts.end(); )
+ {
+ if((opt->get_short()!=0 && (*i)->get_short()==opt->get_short()) || (*i)->get_long()==opt->get_long())
+ {
+ delete *i;
+ opts.erase(i++);
+ }
+ else
+ ++i;
+ }
+
+ opts.push_back(opt);
+ return *opts.back();
+}
+
GetOpt::OptBase &GetOpt::get_option(char s)
{
for(list<OptBase *>::iterator i=opts.begin(); i!=opts.end(); ++i)