Index: lemon/arg_parser.cc
===================================================================
--- lemon/arg_parser.cc	(revision 137)
+++ lemon/arg_parser.cc	(revision 209)
@@ -1,5 +1,5 @@
-/* -*- C++ -*-
+/* -*- mode: C++; indent-tabs-mode: nil; -*-
  *
- * This file is a part of LEMON, a generic C++ optimization library
+ * This file is a part of LEMON, a generic C++ optimization library.
  *
  * Copyright (C) 2003-2008
@@ -39,28 +39,28 @@
     for(Opts::iterator i=_opts.begin();i!=_opts.end();++i)
       if(i->second.self_delete)
-	switch(i->second.type) {
-	case BOOL:
-	  delete i->second.bool_p;
-	  break;
-	case STRING:
-	  delete i->second.string_p;
-	  break;
-	case DOUBLE:
-	  delete i->second.double_p;
-	  break;
-	case INTEGER:
-	  delete i->second.int_p;
-	  break;
-	case UNKNOWN:
-	  break;
-	case FUNC:
-	  break;
-	}
-  }
-  
+        switch(i->second.type) {
+        case BOOL:
+          delete i->second.bool_p;
+          break;
+        case STRING:
+          delete i->second.string_p;
+          break;
+        case DOUBLE:
+          delete i->second.double_p;
+          break;
+        case INTEGER:
+          delete i->second.int_p;
+          break;
+        case UNKNOWN:
+          break;
+        case FUNC:
+          break;
+        }
+  }
+
 
   ArgParser &ArgParser::intOption(const std::string &name,
-			       const std::string &help,
-			       int value, bool obl)
+                               const std::string &help,
+                               int value, bool obl)
   {
     ParData p;
@@ -75,6 +75,6 @@
 
   ArgParser &ArgParser::doubleOption(const std::string &name,
-			       const std::string &help,
-			       double value, bool obl)
+                               const std::string &help,
+                               double value, bool obl)
   {
     ParData p;
@@ -89,6 +89,6 @@
 
   ArgParser &ArgParser::boolOption(const std::string &name,
-			       const std::string &help,
-			       bool value, bool obl)
+                               const std::string &help,
+                               bool value, bool obl)
   {
     ParData p;
@@ -103,6 +103,6 @@
 
   ArgParser &ArgParser::stringOption(const std::string &name,
-			       const std::string &help,
-			       std::string value, bool obl)
+                               const std::string &help,
+                               std::string value, bool obl)
   {
     ParData p;
@@ -117,6 +117,6 @@
 
   ArgParser &ArgParser::refOption(const std::string &name,
-			       const std::string &help,
-			       int &ref, bool obl)
+                               const std::string &help,
+                               int &ref, bool obl)
   {
     ParData p;
@@ -162,6 +162,6 @@
 
   ArgParser &ArgParser::refOption(const std::string &name,
-			       const std::string &help,
-			       std::string &ref, bool obl)
+                               const std::string &help,
+                               std::string &ref, bool obl)
   {
     ParData p;
@@ -176,6 +176,6 @@
 
   ArgParser &ArgParser::funcOption(const std::string &name,
-			       const std::string &help,
-			       void (*func)(void *),void *data)
+                               const std::string &help,
+                               void (*func)(void *),void *data)
   {
     ParData p;
@@ -191,9 +191,9 @@
 
   ArgParser &ArgParser::optionGroup(const std::string &group,
-				    const std::string &opt)
+                                    const std::string &opt)
   {
     Opts::iterator i = _opts.find(opt);
     LEMON_ASSERT(i!=_opts.end(), "Unknown option: '"+opt+"'");
-    LEMON_ASSERT(!(i->second.ingroup), 
+    LEMON_ASSERT(!(i->second.ingroup),
                  "Option already in option group: '"+opt+"'");
     GroupData &g=_groups[group];
@@ -211,5 +211,5 @@
 
   ArgParser &ArgParser::synonym(const std::string &syn,
-				const std::string &opt)
+                                const std::string &opt)
   {
     Opts::iterator o = _opts.find(opt);
@@ -234,5 +234,5 @@
 
   ArgParser &ArgParser::other(const std::string &name,
-			      const std::string &help)
+                              const std::string &help)
   {
     _others_help.push_back(OtherArg(name,help));
@@ -245,6 +245,6 @@
     if(i->second.has_syn)
       for(Opts::iterator j=_opts.begin();j!=_opts.end();++j)
-	if(j->second.syn&&j->second.help==i->first)
-	  os << "|-" << j->first;
+        if(j->second.syn&&j->second.help==i->first)
+          os << "|-" << j->first;
     switch(i->second.type) {
     case STRING:
@@ -271,5 +271,5 @@
     }
   }
-    
+
   void ArgParser::showHelp(Opts::iterator i)
   {
@@ -284,7 +284,7 @@
     if(i->help.size()==0) return;
     std::cerr << "  " << i->name << std::endl
-	      << "     " << i->help << std::endl;
-  }
-    
+              << "     " << i->help << std::endl;
+  }
+
   void ArgParser::shortHelp()
   {
@@ -300,6 +300,6 @@
       if(!g->second.mandatory) cstr << ']';
       if(pos+cstr.str().size()>LINE_LEN) {
-	std::cerr << std::endl << indent;
-	pos=indent.size();
+        std::cerr << std::endl << indent;
+        pos=indent.size();
       }
       std::cerr << cstr.str();
@@ -308,32 +308,32 @@
     for(Opts::iterator i=_opts.begin();i!=_opts.end();++i)
       if(!i->second.ingroup&&!i->second.syn) {
-	std::ostringstream cstr;
-	cstr << ' ';
-	if(!i->second.mandatory) cstr << '[';
-	show(cstr,i);
-	if(!i->second.mandatory) cstr << ']';
-	if(pos+cstr.str().size()>LINE_LEN) {
-	  std::cerr << std::endl << indent;
-	  pos=indent.size();
-	}
-	std::cerr << cstr.str();
-	pos+=cstr.str().size();
+        std::ostringstream cstr;
+        cstr << ' ';
+        if(!i->second.mandatory) cstr << '[';
+        show(cstr,i);
+        if(!i->second.mandatory) cstr << ']';
+        if(pos+cstr.str().size()>LINE_LEN) {
+          std::cerr << std::endl << indent;
+          pos=indent.size();
+        }
+        std::cerr << cstr.str();
+        pos+=cstr.str().size();
       }
     for(std::vector<OtherArg>::iterator i=_others_help.begin();
-	i!=_others_help.end();++i)
+        i!=_others_help.end();++i)
       {
-	std::ostringstream cstr;
-	cstr << ' ' << i->name;
-      
-	if(pos+cstr.str().size()>LINE_LEN) {
-	  std::cerr << std::endl << indent;
-	  pos=indent.size();
-	}
-	std::cerr << cstr.str();
-	pos+=cstr.str().size();
+        std::ostringstream cstr;
+        cstr << ' ' << i->name;
+
+        if(pos+cstr.str().size()>LINE_LEN) {
+          std::cerr << std::endl << indent;
+          pos=indent.size();
+        }
+        std::cerr << cstr.str();
+        pos+=cstr.str().size();
       }
     std::cerr << std::endl;
   }
-    
+
   void ArgParser::showHelp()
   {
@@ -341,11 +341,11 @@
     std::cerr << "Where:\n";
     for(std::vector<OtherArg>::iterator i=_others_help.begin();
-	i!=_others_help.end();++i) showHelp(i);
+        i!=_others_help.end();++i) showHelp(i);
     for(Opts::iterator i=_opts.begin();i!=_opts.end();++i) showHelp(i);
     exit(1);
   }
-    
-      
-  void ArgParser::unknownOpt(std::string arg) 
+
+
+  void ArgParser::unknownOpt(std::string arg)
   {
     std::cerr << "\nUnknown option: " << arg << "\n";
@@ -354,6 +354,6 @@
     exit(1);
   }
-    
-  void ArgParser::requiresValue(std::string arg, OptType t) 
+
+  void ArgParser::requiresValue(std::string arg, OptType t)
   {
     std::cerr << "Argument '" << arg << "' requires a";
@@ -374,5 +374,5 @@
     showHelp();
   }
-    
+
 
   void ArgParser::checkMandatories()
@@ -380,39 +380,39 @@
     bool ok=true;
     for(Opts::iterator i=_opts.begin();i!=_opts.end();++i)
-      if(i->second.mandatory&&!i->second.set) 
-	{
-	  if(ok)
-	    std::cerr << _command_name 
-		      << ": The following mandatory arguments are missing.\n";
-	  ok=false;
-	  showHelp(i);
-	}
+      if(i->second.mandatory&&!i->second.set)
+        {
+          if(ok)
+            std::cerr << _command_name
+                      << ": The following mandatory arguments are missing.\n";
+          ok=false;
+          showHelp(i);
+        }
     for(Groups::iterator i=_groups.begin();i!=_groups.end();++i)
       if(i->second.mandatory||i->second.only_one)
-	{
-	  int set=0;
-	  for(GroupData::Opts::iterator o=i->second.opts.begin();
-	      o!=i->second.opts.end();++o)
-	    if(_opts.find(*o)->second.set) ++set;
-	  if(i->second.mandatory&&!set) {
-	    std::cerr << _command_name 
-		      << ": At least one of the following arguments is mandatory.\n";
-	    ok=false;
-	    for(GroupData::Opts::iterator o=i->second.opts.begin();
-		o!=i->second.opts.end();++o)
-	      showHelp(_opts.find(*o));
-	  }
-	  if(i->second.only_one&&set>1) {
-	    std::cerr << _command_name 
-		      << ": At most one of the following arguments can be given.\n";
-	    ok=false;
-	    for(GroupData::Opts::iterator o=i->second.opts.begin();
-		o!=i->second.opts.end();++o)
-	      showHelp(_opts.find(*o));
-	  }
-	}
+        {
+          int set=0;
+          for(GroupData::Opts::iterator o=i->second.opts.begin();
+              o!=i->second.opts.end();++o)
+            if(_opts.find(*o)->second.set) ++set;
+          if(i->second.mandatory&&!set) {
+            std::cerr << _command_name
+                      << ": At least one of the following arguments is mandatory.\n";
+            ok=false;
+            for(GroupData::Opts::iterator o=i->second.opts.begin();
+                o!=i->second.opts.end();++o)
+              showHelp(_opts.find(*o));
+          }
+          if(i->second.only_one&&set>1) {
+            std::cerr << _command_name
+                      << ": At most one of the following arguments can be given.\n";
+            ok=false;
+            for(GroupData::Opts::iterator o=i->second.opts.begin();
+                o!=i->second.opts.end();++o)
+              showHelp(_opts.find(*o));
+          }
+        }
     if(!ok) {
       std::cerr << "\nType '" << _command_name <<
-	" --help' to obtain a short summary on the usage.\n\n";
+        " --help' to obtain a short summary on the usage.\n\n";
       exit(1);
     }
@@ -424,36 +424,36 @@
       std::string arg(_argv[ar]);
       if (arg[0] != '-' || arg.size() == 1) {
-	_file_args.push_back(arg);
+        _file_args.push_back(arg);
       }
       else {
-	Opts::iterator i = _opts.find(arg.substr(1));
-	if(i==_opts.end()) unknownOpt(arg);
-	else {
-	  if(i->second.syn) i=_opts.find(i->second.help);
-	  ParData &p(i->second);
-	  if (p.type==BOOL) *p.bool_p=true;
-	  else if (p.type==FUNC) p.func_p.p(p.func_p.data);
-	  else if(++ar==_argc) requiresValue(arg, p.type);
-	  else {
-	    std::string val(_argv[ar]);
-	    std::istringstream vals(val);
-	    switch(p.type) {
-	    case STRING:
-	      *p.string_p=val;
-	      break;
-	    case INTEGER:
-	      vals >> *p.int_p;
-	      break;
-	    case DOUBLE:
-	      vals >> *p.double_p;
-	      break;
-	    default:
-	      break;
-	    }
-	    if(p.type!=STRING&&(!vals||!vals.eof()))
-	      requiresValue(arg, p.type);
-	  }
-	  p.set = true;
-	}
+        Opts::iterator i = _opts.find(arg.substr(1));
+        if(i==_opts.end()) unknownOpt(arg);
+        else {
+          if(i->second.syn) i=_opts.find(i->second.help);
+          ParData &p(i->second);
+          if (p.type==BOOL) *p.bool_p=true;
+          else if (p.type==FUNC) p.func_p.p(p.func_p.data);
+          else if(++ar==_argc) requiresValue(arg, p.type);
+          else {
+            std::string val(_argv[ar]);
+            std::istringstream vals(val);
+            switch(p.type) {
+            case STRING:
+              *p.string_p=val;
+              break;
+            case INTEGER:
+              vals >> *p.int_p;
+              break;
+            case DOUBLE:
+              vals >> *p.double_p;
+              break;
+            default:
+              break;
+            }
+            if(p.type!=STRING&&(!vals||!vals.eof()))
+              requiresValue(arg, p.type);
+          }
+          p.set = true;
+        }
       }
     }
@@ -461,5 +461,5 @@
 
     return *this;
-  }  
+  }
 
 }
