Index: trunk/FACT++/gui/fact.cc
===================================================================
--- trunk/FACT++/gui/fact.cc	(revision 11577)
+++ trunk/FACT++/gui/fact.cc	(revision 11578)
@@ -51,30 +51,6 @@
     SetupConfiguration(conf);
 
-    po::variables_map vm;
-    try
-    {
-        vm = conf.Parse(argc, argv);
-    }
-#if BOOST_VERSION > 104000
-    catch (po::multiple_occurrences &e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl;
+    if (!conf.DoParse(argc, argv, PrintHelp))
         return -1;
-    }
-#endif
-    catch (exception& e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << endl;
-        return -1;
-    }
-
-    if (conf.HasVersion() || conf.HasPrint())
-        return -1;
-
-    if (conf.HasHelp())
-    {
-        PrintHelp();
-        return -1;
-    }
 
     Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host"));
Index: trunk/FACT++/src/Configuration.cc
===================================================================
--- trunk/FACT++/src/Configuration.cc	(revision 11577)
+++ trunk/FACT++/src/Configuration.cc	(revision 11578)
@@ -1233,4 +1233,36 @@
 }
 
+bool Configuration::DoParse(int argc, const char **argv, const std::function<void()> &PrintHelp)
+{
+    try
+    {
+        Parse(argc, argv);
+    }
+#if BOOST_VERSION > 104000
+    catch (po::multiple_occurrences &e)
+    {
+        cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl;
+        return false;
+    }
+#endif
+    catch (exception& e)
+    {
+        cerr << "Program options invalid due to: " << e.what() << endl;
+        return false;
+    }
+
+    if (HasVersion() || HasPrint())
+        return false;
+
+    if (HasHelp())
+    {
+        if (PrintHelp)
+            PrintHelp();
+        return false;
+    }
+
+    return true;
+}
+
 // --------------------------------------------------------------------------
 //
Index: trunk/FACT++/src/Configuration.h
===================================================================
--- trunk/FACT++/src/Configuration.h	(revision 11577)
+++ trunk/FACT++/src/Configuration.h	(revision 11578)
@@ -125,4 +125,5 @@
     // Process command line arguments
     const po::variables_map &Parse(int argc, const char **argv);
+    bool DoParse(int argc, const char **argv, const std::function<void()> &func=std::function<void()>());
 
     bool HasVersion()
Index: trunk/FACT++/src/biasctrl.cc
===================================================================
--- trunk/FACT++/src/biasctrl.cc	(revision 11577)
+++ trunk/FACT++/src/biasctrl.cc	(revision 11578)
@@ -622,30 +622,6 @@
     SetupConfiguration(conf);
 
-    po::variables_map vm;
-    try
-    {
-        vm = conf.Parse(argc, argv);
-    }
-#if BOOST_VERSION > 104000
-    catch (po::multiple_occurrences &e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl;
+    if (!conf.DoParse(argc, argv, PrintHelp))
         return -1;
-    }
-#endif
-    catch (exception& e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << endl;
-        return -1;
-    }
-
-    if (conf.HasVersion() || conf.HasPrint())
-        return -1;
-
-    if (conf.HasHelp())
-    {
-        PrintHelp();
-        return -1;
-    }
 
     //try
Index: trunk/FACT++/src/chatclient.cc
===================================================================
--- trunk/FACT++/src/chatclient.cc	(revision 11577)
+++ trunk/FACT++/src/chatclient.cc	(revision 11578)
@@ -79,30 +79,6 @@
     SetupConfiguration(conf);
 
-    po::variables_map vm;
-    try
-    {
-        vm = conf.Parse(argc, argv);
-    }
-#if BOOST_VERSION > 104000
-    catch (po::multiple_occurrences &e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl;
+    if (!conf.DoParse(argc, argv, PrintHelp))
         return -1;
-    }
-#endif
-    catch (exception& e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << endl;
-        return -1;
-    }
-
-    if (conf.HasVersion() || conf.HasPrint())
-        return -1;
-
-    if (conf.HasHelp())
-    {
-        PrintHelp();
-        return -1;
-    }
 
     Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host"));
Index: trunk/FACT++/src/chatserv.cc
===================================================================
--- trunk/FACT++/src/chatserv.cc	(revision 11577)
+++ trunk/FACT++/src/chatserv.cc	(revision 11578)
@@ -79,30 +79,6 @@
     SetupConfiguration(conf);
 
-    po::variables_map vm;
-    try
-    {
-        vm = conf.Parse(argc, argv);
-    }
-#if BOOST_VERSION > 104000
-    catch (po::multiple_occurrences &e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl;
+    if (!conf.DoParse(argc, argv, PrintHelp))
         return -1;
-    }
-#endif
-    catch (exception& e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << endl;
-        return -1;
-    }
-
-    if (conf.HasVersion() || conf.HasPrint())
-        return -1;
-
-    if (conf.HasHelp())
-    {
-        PrintHelp();
-        return -1;
-    }
 
     Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host"));
Index: trunk/FACT++/src/datalogger.cc
===================================================================
--- trunk/FACT++/src/datalogger.cc	(revision 11577)
+++ trunk/FACT++/src/datalogger.cc	(revision 11578)
@@ -2468,30 +2468,6 @@
     SetupConfiguration(conf);
 
-    po::variables_map vm;
-    try
-    {
-        vm = conf.Parse(argc, argv);
-    }
-#if BOOST_VERSION > 104000
-    catch (po::multiple_occurrences &e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl;
+    if (!conf.DoParse(argc, argv, PrintHelp))
         return -1;
-    }
-#endif
-    catch (exception& e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << endl;
-        return -1;
-    }
-
-    if (conf.HasVersion() || conf.HasPrint())
-        return -1;
-
-    if (conf.HasHelp())
-    {
-        PrintHelp();
-        return -1;
-    }
 
 //    try
Index: trunk/FACT++/src/dimctrl.cc
===================================================================
--- trunk/FACT++/src/dimctrl.cc	(revision 11577)
+++ trunk/FACT++/src/dimctrl.cc	(revision 11578)
@@ -70,30 +70,6 @@
     Main::SetupConfiguration(conf);
 
-    po::variables_map vm;
-    try
-    {
-        vm = conf.Parse(argc, argv);
-    }
-#if BOOST_VERSION > 104000
-    catch (po::multiple_occurrences &e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl;
+    if (!conf.DoParse(argc, argv, PrintHelp))
         return -1;
-    }
-#endif
-    catch (exception& e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << endl;
-        return -1;
-    }
-
-    if (conf.HasVersion() || conf.HasPrint())
-        return -1;
-
-    if (conf.HasHelp())
-    {
-        PrintHelp();
-        return -1;
-    }
 
     Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host"));
Index: trunk/FACT++/src/drivectrl.cc
===================================================================
--- trunk/FACT++/src/drivectrl.cc	(revision 11577)
+++ trunk/FACT++/src/drivectrl.cc	(revision 11578)
@@ -999,30 +999,6 @@
     SetupConfiguration(conf);
 
-    po::variables_map vm;
-    try
-    {
-        vm = conf.Parse(argc, argv);
-    }
-#if BOOST_VERSION > 104000
-    catch (po::multiple_occurrences &e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl;
+    if (!conf.DoParse(argc, argv, PrintHelp))
         return -1;
-    }
-#endif
-    catch (exception& e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << endl;
-        return -1;
-    }
-
-    if (conf.HasVersion() || conf.HasPrint())
-        return -1;
-
-    if (conf.HasHelp())
-    {
-        PrintHelp();
-        return -1;
-    }
 
     //try
Index: trunk/FACT++/src/fadctrl.cc
===================================================================
--- trunk/FACT++/src/fadctrl.cc	(revision 11577)
+++ trunk/FACT++/src/fadctrl.cc	(revision 11578)
@@ -2069,30 +2069,6 @@
     SetupConfiguration(conf);
 
-    po::variables_map vm;
-    try
-    {
-        vm = conf.Parse(argc, argv);
-    }
-#if BOOST_VERSION > 104000
-    catch (po::multiple_occurrences &e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl;
+    if (!conf.DoParse(argc, argv, PrintHelp))
         return -1;
-    }
-#endif
-    catch (exception& e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << endl;
-        return -1;
-    }
-
-    if (conf.HasVersion() || conf.HasPrint())
-        return -1;
-
-    if (conf.HasHelp())
-    {
-        PrintHelp();
-        return -1;
-    }
 
 //    try
Index: trunk/FACT++/src/fitsdump.cc
===================================================================
--- trunk/FACT++/src/fitsdump.cc	(revision 11577)
+++ trunk/FACT++/src/fitsdump.cc	(revision 11578)
@@ -682,30 +682,6 @@
     SetupConfiguration(conf);
 
-    po::variables_map vm;
-    try
-    {
-        vm = conf.Parse(argc, argv);
-    }
-#if BOOST_VERSION > 104000
-    catch (po::multiple_occurrences &e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << " of option '" << e.get_option_name() << "'." << endl;
+    if (!conf.DoParse(argc, argv, PrintHelp))
         return -1;
-    }
-#endif
-    catch (exception& e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << endl;
-        return -1;
-    }
-
-    if (conf.HasVersion() || conf.HasPrint())
-        return -1;
-
-    if (conf.HasHelp())
-    {
-        PrintHelp();
-        return -1;
-    }
 
     FitsDumper loader;
Index: trunk/FACT++/src/fitsloader.cc
===================================================================
--- trunk/FACT++/src/fitsloader.cc	(revision 11577)
+++ trunk/FACT++/src/fitsloader.cc	(revision 11578)
@@ -676,30 +676,6 @@
     SetupConfiguration(conf);
 
-    po::variables_map vm;
-    try
-    {
-        vm = conf.Parse(argc, argv);
-    }
-#if BOOST_VERSION > 104000
-    catch (po::multiple_occurrences &e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl;
+    if (!conf.DoParse(argc, argv, PrintHelp))
         return -1;
-    }
-#endif
-    catch (exception& e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << endl;
-        return -1;
-    }
-
-    if (conf.HasVersion() || conf.HasPrint())
-        return -1;
-
-    if (conf.HasHelp())
-    {
-        PrintHelp();
-        return -1;
-    }
 
 //    if (!conf.Has("console"))
Index: trunk/FACT++/src/fscctrl.cc
===================================================================
--- trunk/FACT++/src/fscctrl.cc	(revision 11577)
+++ trunk/FACT++/src/fscctrl.cc	(revision 11578)
@@ -588,30 +588,6 @@
     SetupConfiguration(conf);
 
-    po::variables_map vm;
-    try
-    {
-        vm = conf.Parse(argc, argv);
-    }
-#if BOOST_VERSION > 104000
-    catch (po::multiple_occurrences &e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl;
+    if (!conf.DoParse(argc, argv, PrintHelp))
         return -1;
-    }
-#endif
-    catch (exception& e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << endl;
-        return -1;
-    }
-
-    if (conf.HasVersion() || conf.HasPrint())
-        return -1;
-
-    if (conf.HasHelp())
-    {
-        PrintHelp();
-        return -1;
-    }
 
     //try
Index: trunk/FACT++/src/ftmctrl.cc
===================================================================
--- trunk/FACT++/src/ftmctrl.cc	(revision 11577)
+++ trunk/FACT++/src/ftmctrl.cc	(revision 11578)
@@ -2444,30 +2444,6 @@
     SetupConfiguration(conf);
 
-    po::variables_map vm;
-    try
-    {
-        vm = conf.Parse(argc, argv);
-    }
-#if BOOST_VERSION > 104000
-    catch (po::multiple_occurrences &e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl;
+    if (!conf.DoParse(argc, argv, PrintHelp))
         return -1;
-    }
-#endif
-    catch (exception& e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << endl;
-        return -1;
-    }
-
-    if (conf.HasVersion() || conf.HasPrint())
-        return -1;
-
-    if (conf.HasHelp())
-    {
-        PrintHelp();
-        return -1;
-    }
 
     //try
Index: trunk/FACT++/src/mcp.cc
===================================================================
--- trunk/FACT++/src/mcp.cc	(revision 11577)
+++ trunk/FACT++/src/mcp.cc	(revision 11578)
@@ -478,30 +478,6 @@
     Main::SetupConfiguration(conf);
 
-    po::variables_map vm;
-    try
-    {
-        vm = conf.Parse(argc, argv);
-    }
-#if BOOST_VERSION > 104000
-    catch (po::multiple_occurrences &e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl;
+    if (!conf.DoParse(argc, argv, PrintHelp))
         return -1;
-    }
-#endif
-    catch (exception& e)
-    {
-        cerr << "Program options invalid due to: " << e.what() << endl;
-        return -1;
-    }
-
-    if (conf.HasVersion() || conf.HasPrint())
-        return -1;
-
-    if (conf.HasHelp())
-    {
-        PrintHelp();
-        return -1;
-    }
 
     //try
Index: trunk/FACT++/src/triggerschedule.cc
===================================================================
--- trunk/FACT++/src/triggerschedule.cc	(revision 11577)
+++ trunk/FACT++/src/triggerschedule.cc	(revision 11578)
@@ -58,33 +58,6 @@
     SetupConfiguration(conf);
 
-    po::variables_map vm;
-    try
-    {
-        vm = conf.Parse(argc, argv);
-    }
-#if BOOST_VERSION > 104000
-    catch (po::multiple_occurrences &e)
-    {
-        cout << "Error: " << e.what() << " of '" << e.get_option_name() << "' option." << endl;
-        cout << endl;
+    if (!conf.DoParse(argc, argv, PrintHelp))
         return -1;
-    }
-#endif
-    catch (std::exception &e)
-    {
-        cout << "Error: " << e.what() << endl;
-        cout << endl;
-
-        return -1;
-    }
-
-    if (conf.HasVersion() || conf.HasPrint())
-        return -1;
-
-    if (conf.HasHelp())
-    {
-        PrintHelp();
-        return -1;
-    }
 
     const string dbname = conf.Get<string>("schedule-database-name");
