From 05c75007838977c09e25c969c405065df5fd3fa3 Mon Sep 17 00:00:00 2001
From: Christian Beckmann <c.beckmann@donders.ru.nl>
Date: Fri, 13 Sep 2002 18:03:18 +0000
Subject: [PATCH] *** empty log message ***

---
 options.h | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/options.h b/options.h
index c6df9ae..a8c0c12 100644
--- a/options.h
+++ b/options.h
@@ -5,6 +5,7 @@
 #include <stdexcept>
 #include <string>
 #include <vector>
+#include <iostream>
 
 #define POSIX_SOURCE 1
 
@@ -198,13 +199,16 @@ namespace Utilities {
   /**
      Throw this exception if an error occured inside the Options package.
    */
-/*   class X_OptionError: public std::exception { */
-/*   public: */
-/*     X_OptionError() throw() {}; */
-/*     virtual const char * what() const throw() { */
-/*       return "There were errors parsing the command line!";    */
-/*     } */
-/*   }; */
+  class X_OptionError: public std::exception {
+  public:
+    X_OptionError() throw() {};
+    X_OptionError(const string& s) throw() {cerr << s << endl;}
+    X_OptionError(const string& o, const string& v) throw() {
+      cerr << o << ":invalid argument " << v <<"!" <<endl; }
+    virtual const char * what() const throw() {
+      return "There were errors parsing the command line!";   
+    }
+  };
 
   /**
      Throw this exception if no matching option was found during parsing.
@@ -250,8 +254,8 @@ namespace Utilities {
 /*     string str_; */
 /*   }; */
 
-/*   /** */
-/*    */ */
+/*    */
+/*    */ 
 /*   class X_InvalidArgument: public X_OptionError { */
 /*   public: */
 /*     X_InvalidArgument(const string& o, const string& v) throw():  */
@@ -393,8 +397,8 @@ int main(unsigned int argc, char **argv) {
        @return true on success.
     */
     unsigned int parse_option(const string& optstr, const string& valstr)
-      //  throw(X_AlreadySet, X_UnknownOption, 
-      //	    X_MissingArgument, X_InvalidArgument);
+      throw(X_OptionError);
+
     /**
        @param str A string of the form --option[=value].
        @return true on success.
-- 
GitLab