Index: /trunk/FACT++/src/dclient5.cc
===================================================================
--- /trunk/FACT++/src/dclient5.cc	(revision 10346)
+++ /trunk/FACT++/src/dclient5.cc	(revision 10347)
@@ -267,6 +267,4 @@
 
         AddTransition(kSM_SetUrl, "SETURL", "C");
-
-        T::PrintListOfEvents();
     }
 
@@ -498,4 +496,89 @@
 }
 
+/*
+ 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 console connects to all available Dim Servers and allows to "
+        "easily access all of their commands.\n"
+        "\n"
+        "Usage: test3 [-c type] [OPTIONS]\n"
+        "  or:  test3 [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)
 {
@@ -518,4 +601,5 @@
 {
     Configuration conf(argv[0]);
+    conf.SetPrintUsage(PrintUsage);
     SetupConfiguration(conf);
 
@@ -539,6 +623,18 @@
     }
 
-    if (conf.HasHelp() || conf.HasPrint())
+    if (conf.HasPrint())
         return -1;
+
+    if (conf.HasVersion())
+    {
+        PrintVersion(argv[0]);
+        return -1;
+    }
+
+    if (conf.HasHelp())
+    {
+        PrintHelp();
+        return -1;
+    }
 
     // To allow overwriting of DIM_DNS_NODE set 0 to 1
Index: /trunk/FACT++/src/logtime.cc
===================================================================
--- /trunk/FACT++/src/logtime.cc	(revision 10346)
+++ /trunk/FACT++/src/logtime.cc	(revision 10347)
@@ -6,7 +6,76 @@
 #include <iostream>
 
+class DimDescriptionService
+{
+    static int         fCount;
+    static DimService *fService;
+    static std::string fFormat;
+
+    std::string fFmt;
+
+public:
+    DimDescriptionService(const std::string &name, const std::string &format)
+    {
+        // FIXME: throw is DimServer::itsName==0
+
+        std::string n = std::string(DimServer::itsName)+"/SERVICE_DESC";
+
+        if (!fService)
+            fService = new DimService(n.c_str(), const_cast<char*>(""));
+
+        fCount++;
+
+        fFmt = name + '=' + format + '\n';
+
+        if (fFormat.find(fFmt)!=std::string::npos)
+            return;
+
+        fFormat += fFmt;
+
+        fService->setData(const_cast<char*>(fFormat.c_str()));
+        fService->updateService();
+
+    }
+    ~DimDescriptionService()
+    {
+        const size_t pos = fFormat.find(fFmt);
+        if (pos!=std::string::npos)
+            fFormat.replace(pos, fFmt.size(), "");
+
+        if (--fCount>0)
+            return;
+
+        delete fService;
+        fService=0;
+    }
+};
+
+class DimDescribedService : public DimDescriptionService, public DimService
+{
+public:
+    template<typename T>
+        DimDescribedService(const char *name, T &val, const char *desc)
+        : DimDescriptionService(name, desc), DimService(name, val)
+    {
+    }
+
+    DimDescribedService(const char *name, const char *val, const char *desc)
+        : DimDescriptionService(name, desc), DimService(name, const_cast<char*>(val)) { }
+
+    DimDescribedService(const char *name, char *format, void *structure, int size, const char *desc)
+        : DimDescriptionService(name, desc), DimService(name, format, structure, size)
+    {
+        // FIXME: compare number of ; with number of |
+    }
+};
+
+DimService *DimDescriptionService::fService = 0;
+int DimDescriptionService::fCount = 0;
+std::string DimDescriptionService::fFormat;
+
+
 int main(int, const char **)
 {
-   // We could use putenv to make the Configure class change the value...
+    // We could use putenv to make the Configure class change the value...
     setenv("DIM_DNS_NODE", "localhost", 0);
 
@@ -17,4 +86,21 @@
     std::cout << "Offering TIME/MESSAGE...\n" << std::endl;
 
+    short s;
+    int i;
+    long long ll;
+    float f;
+    DimDescribedService servt("TIME/TEST", "C:1;I:1;C", NULL, 0,
+                              "Char[c]:This is a char|   Int This is an int|String[s]:This is a string");
+
+    DimDescribedService servs("TIME/SHORT",     s,  "[a]");
+    DimDescribedService servx("TIME/LONGLONG",  ll, ": This is my long long");
+    DimDescribedService servi("TIME/INT",       i,  "MyInt{mi}");
+    DimDescribedService servf("TIME/FLOAT",     f,  "   MyFloat  :   This is my float");
+    DimDescribedService servc("TIME/TIME", const_cast<char*>(""), "MyTime[T]:This is my time");
+
+    DimCommand cmd("TIME/CMD", "I:2;F:2");
+
+    DimDescriptionService des("TIME/CMD", "range[addr]:From DAC to DAC|values[DAC]:DAC values to be set");
+
     // Setup a DimService called TIME/MESSAGE
     MessageDimTX msg("TIME");
@@ -23,7 +109,13 @@
         // Send current time
         msg.Message(Time().GetAsStr());
-
+//        servx.Update();
+        /*
+        servs.updateService();
+        servi.updateService();
+        servf.updateService();
+        servc.updateService();
+         */
         // wait approximately one second
-        usleep(1000000);
+        usleep(100000);
     }
 
Index: /trunk/FACT++/src/test3.cc
===================================================================
--- /trunk/FACT++/src/test3.cc	(revision 10346)
+++ /trunk/FACT++/src/test3.cc	(revision 10347)
@@ -60,5 +60,5 @@
 void PrintUsage()
 {
-    cout <<
+    cout << "\n"
         "The console connects to all available Dim Servers and allows to "
         "easily access all of their commands.\n"
