Index: trunk/FACT++/src/dataLogger.cc
===================================================================
--- trunk/FACT++/src/dataLogger.cc	(revision 10377)
+++ trunk/FACT++/src/dataLogger.cc	(revision 10392)
@@ -890,9 +890,9 @@
 	 
 	//Init the time columns of the file
-	Description dateDesc(std::string("Time"), std::string("MjD"), std::string("Modified Julian Date"));
+	Description dateDesc(std::string("Time"), std::string("Modified Julian Date"), std::string("MjD"));
 	sub.dailyFile.AddStandardColumn(dateDesc, "1D", &fMjD, sizeof(double));
 	sub.runFile.AddStandardColumn(dateDesc, "1D", &fMjD, sizeof(double));
 
-	Description QoSDesc("Qos", "None", "Quality of service");
+	Description QoSDesc("Qos", "Quality of service", "None");
 	sub.dailyFile.AddStandardColumn(QoSDesc, "1J", &fQuality, sizeof(int));
 	sub.runFile.AddStandardColumn(QoSDesc, "1J", &fQuality, sizeof(int));
@@ -1103,12 +1103,97 @@
 }
 
+/*
+ Extract usage clause(s) [if any] for SYNOPSIS.
+ Translators: "Usage" and "or" here are patterns (regular expressions) which
+ are used to match the usage synopsis in program output.  An example from cp
+ (GNU coreutils) which contains both strings:
+  Usage: cp [OPTION]... [-T] SOURCE DEST
+    or:  cp [OPTION]... SOURCE... DIRECTORY
+    or:  cp [OPTION]... -t DIRECTORY SOURCE...
+ */
+void PrintUsage()
+{
+    cout << "\n"
+        "The data logger connects to all available Dim services and "
+        "writes them to ascii and fits files.\n"
+        "\n"
+        "Usage: dataLogger [-c type] [OPTIONS]\n"
+        "  or:  dataLogger [OPTIONS]\n"
+        "\n"
+        "Options:\n"
+        "The following describes the available commandline options. "
+        "For further details on how command line option are parsed "
+        "and in which order which configuration sources are accessed "
+        "please refer to the class reference of the Configuration class.";
+    cout << endl;
+
+}
+
+void PrintHelp()
+{
+    cout << "\n"
+        "The default is that the program is started without user interaction. "
+        "All actions are supposed to arrive as DimCommands. Using the -c "
+        "option, a local shell can be initialized. With h or help a short "
+        "help message about the usuage can be brought to the screen."
+        << endl;
+
+    /*
+     cout << "bla bla bla" << endl << endl;
+     cout << endl;
+     cout << "Environment:" << endl;
+     cout << "environment" << endl;
+     cout << endl;
+     cout << "Examples:" << endl;
+     cout << "test exam" << endl;
+     cout << endl;
+     cout << "Files:" << endl;
+     cout << "files" << endl;
+     cout << endl;
+     */
+}
+
+/*
+ The first line of the --version information is assumed to be in one
+ of the following formats:
+
+   <version>
+   <program> <version>
+   {GNU,Free} <program> <version>
+   <program> ({GNU,Free} <package>) <version>
+   <program> - {GNU,Free} <package> <version>
+
+ and separated from any copyright/author details by a blank line.
+
+ Handle multi-line bug reporting sections of the form:
+
+   Report <program> bugs to <addr>
+   GNU <package> home page: <url>
+   ...
+*/
+void PrintVersion(const char *name)
+{
+    cout <<
+        name << " - FACT++ 1.0\n"
+        "\n"
+        "Written by Thomas Bretz <thomas.bretz@epfl.ch> et al.\n"
+        "\n"
+        "Report bugs to Thomas Bretz <thomas.bretz@epfl.ch>\n"
+        "FACT++ home page: http://www.xxx.com\n"
+        "\n"
+        "Copyright (C) 2011 by the FACT Collaboration.\n"
+        "This is free software; see the source for copying conditions.\n"
+        << endl;
+}
+
+
 void SetupConfiguration(Configuration &conf)
 {
-    const std::string n = conf.GetName()+".log";
+    const string n = conf.GetName()+".log";
 
     po::options_description config("Program options");
     config.add_options()
-        ("dns",       var<std::string>("localhost"),       "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)")
-        ("log,l",     var<std::string>(n), "Write log-file")
+        ("dns",       var<string>("localhost"),  "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)")
+        ("log,l",     var<string>(n), "Write log-file")
         ("console,c", var<int>(),     "Use console (0=shell, 1=simple buffered, X=simple unbuffered)")
         ;
@@ -1122,4 +1207,5 @@
 {
     Configuration conf(argv[0]);
+    conf.SetPrintUsage(PrintUsage);
     SetupConfiguration(conf);
 
@@ -1129,22 +1215,32 @@
         vm = conf.Parse(argc, argv);
     }
+    catch (std::exception &e)
+    {
 #if BOOST_VERSION > 104000
-    catch (po::multiple_occurrences &e)
-    {
-        std::cout << "Error: " << e.what() << " of '" << e.get_option_name() << "' option." << std::endl;
-        std::cout << std::endl;
+        po::multiple_occurrences *MO = dynamic_cast<po::multiple_occurrences*>(&e);
+        if (MO)
+            cout << "Error: " << e.what() << " of '" << MO->get_option_name() << "' option." << endl;
+        else
+#endif
+            cout << "Error: " << e.what() << endl;
+        cout << endl;
+
         return -1;
     }
-#endif
-    catch (std::exception &e)
+
+    if (conf.HasPrint())
+        return -1;
+
+    if (conf.HasVersion())
     {
-        std::cout << "Error: " << e.what() << std::endl;
-        std::cout << std::endl;
-
+        PrintVersion(argv[0]);
         return -1;
     }
 
-    if (conf.HasHelp() || conf.HasPrint())
+    if (conf.HasHelp())
+    {
+        PrintHelp();
         return -1;
+    }
 
     setenv("DIM_DNS_NODE", conf.Get<string>("dns").c_str(), 1);
