Index: trunk/FACT++/src/scheduler.cc
===================================================================
--- trunk/FACT++/src/scheduler.cc	(revision 10708)
+++ trunk/FACT++/src/scheduler.cc	(revision 10709)
@@ -38,8 +38,4 @@
 using namespace boost::gregorian;
 using namespace boost::posix_time;
-
-
-// string containing database information
-string database;
 
 // things to be done/checked/changed
@@ -171,4 +167,5 @@
 
     int fSessionId;
+    string fDatabase;
     string fDBName;
 
@@ -196,7 +193,7 @@
 
         boost::smatch what;
-        if (!boost::regex_match(database, what, expr, boost::match_extra))
-        {
-            cout << "Couldn't parse '" << database << "'." << endl;
+        if (!boost::regex_match(fDatabase, what, expr, boost::match_extra))
+        {
+            cout << "Couldn't parse '" << fDatabase << "'." << endl;
             throw;
         }
@@ -204,5 +201,5 @@
         if (what.size()!=10)
         {
-            cout << "Error parsing '" << database << "'." << endl;
+            cout << "Error parsing '" << fDatabase << "'." << endl;
             throw;
         }
@@ -676,4 +673,12 @@
         return T::GetCurrentState();
     }
+
+    bool SetConfiguration(const Configuration &conf)
+    {
+        fDatabase = conf.Get<string>("schedule-database");
+
+        return true;
+    }
+
 };
 
@@ -694,4 +699,7 @@
     // Start io_service.run to only use the commandHandler command detaching
     AutoScheduler<S> io_service(wout);
+    if (!io_service.SetConfiguration(conf))
+        return -1;
+
     io_service.Run();
 
@@ -712,4 +720,7 @@
 
     AutoScheduler<S> io_service(wout);
+    if (!io_service.SetConfiguration(conf))
+        return -1;
+
     shell.SetReceiver(io_service);
 
@@ -738,15 +749,19 @@
     po::options_description config("Configuration");
     config.add_options()
-        ("dns",       var<string>("localhost"),  "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)")
-        ("log,l",     var<string>(n), "Write log-file")
-        ("no-dim,d",  po_switch(),    "Disable dim services")
-        ("console,c", var<int>(),     "Use console (0=shell, 1=simple buffered, X=simple unbuffered)")
-        ("mintime",   var<int>(),     "minimum observation time")
+        ("dns",               var<string>("localhost"),  "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)")
+        ("log,l",             var<string>(n), "Write log-file")
+        ("no-dim,d",          po_switch(),    "Disable dim services")
+        ("console,c",         var<int>(),     "Use console (0=shell, 1=simple buffered, X=simple unbuffered)")
+        ("schedule-database", var<string>()->required(),
+                                              "Database link as in\n\t[user:[password]@][server][:port][/database]\nOverwrites options from the default configuration file.")
+        ("mintime",           var<int>(),     "minimum observation time")
         ;
 
+    po::positional_options_description p;
+    p.add("schedule-database", 1); // The first positional options
+
     conf.AddEnv("dns", "DIM_DNS_NODE");
-
     conf.AddOptions(config);
-    conf.AddOptionsDatabase(config);
+    conf.SetArgumentPositions(p);
 }
 
@@ -761,6 +776,6 @@
         "help message about the usuage can be brought to the screen.\n"
         "\n"
-        "Usage: scheduler [-c type] [OPTIONS]\n"
-        "  or:  scheduler [OPTIONS]\n";
+        "Usage: scheduler [-c type] [OPTIONS] <schedule-database>\n"
+        "  or:  scheduler [OPTIONS] <schedule-database>\n";
     cout << endl;
 }
@@ -812,12 +827,4 @@
     }
 
-    if (!conf.Has("database"))
-    {
-        cout << "Please provide which database you want to use for scheduling." << endl;
-        return -1;
-    }
-
-    database = conf.Get<string>("database").c_str();
-
     Dim::Setup(conf.Get<string>("dns"));
 
