Index: trunk/FACT++/src/Configuration.cc
===================================================================
--- trunk/FACT++/src/Configuration.cc	(revision 10795)
+++ trunk/FACT++/src/Configuration.cc	(revision 10796)
@@ -290,5 +290,5 @@
 #include <boost/bind.hpp>
 #include <boost/regex.hpp>
-//#include <boost/filesystem.hpp>
+#include <boost/filesystem.hpp>
 #include <boost/program_options.hpp>
 
@@ -473,9 +473,9 @@
     po::options_description generic("Generic options");
     generic.add_options()
+        ("version,V",           "Print version information.")
         ("help",                "Print available commandline options.")
         ("help-environment",    "Print available environment variables.")
         ("help-database",       "Print available options retreived from the database.")
         ("help-config",         "Print available configuration file options.")
-        ("version,V",           "Print version information.")
         ("print-all",           "Print all options as parsed from all the different sources.")
         ("print",               "Print options as parsed from the commandline.")
@@ -732,4 +732,14 @@
 {
     fPrintUsage = boost::bind(&Configuration::PrintUsage, this);
+}
+
+void Configuration::SetPrintVersion(const boost::function<void(const string&)> &func)
+{
+    fPrintVersion = func;
+}
+
+void Configuration::SetPrintVersion()
+{
+    fPrintVersion = boost::function<void(const string&)>();
 }
 
@@ -848,4 +858,6 @@
     po::store(parsed_commandline, getfiles);
 
+    if (getfiles.count("version"))
+        PrintVersion();
     if (getfiles.count("help"))
     {
@@ -987,5 +999,4 @@
 
     // ------------------------ (13) -------------------------
-
     po::variables_map result;
     po::store(parsed_commandline,  result);
@@ -1021,2 +1032,87 @@
     return fVariables;
 }
+
+// --------------------------------------------------------------------------
+//
+//! Print version information about the program and package.
+//!
+//! The program name is taken from fName. If a leading "lt-" is found,
+//! it is removed. This is useful if the program was build and run
+//! using libtool.
+//!
+//! The package name is taken from the define PACKAGE_STRING. If it is
+//! not defined (like automatically done by autoconf) no package information
+//! is printed. The same is true for PACKAGE_URL and PACKAGE_BUGREPORT.
+//!
+//! From help2man:
+//!
+//! The first line of the --version information is assumed to be in one
+//! of the following formats:
+//!
+//! \verbatim
+//!  - <version>
+//!  - <program> <version>
+//!  - {GNU,Free} <program> <version>
+//!  - <program> ({GNU,Free} <package>) <version>
+//!  - <program> - {GNU,Free} <package> <version>
+//! \endverbatim
+//!
+//!  and separated from any copyright/author details by a blank line.
+//!
+//! Handle multi-line bug reporting sections of the form:
+//!
+//! \verbatim
+//!  - Report <program> bugs to <addr>
+//!  - GNU <package> home page: <url>
+//!  - ...
+//! \endverbatim
+//!
+//! @param name
+//!     name of the program (usually argv[0]). A possible leading "lt-"
+//!     is removed.
+//!
+void Configuration::PrintVersion() const
+{
+#ifndef PACKAGE_STRING
+#define PACKAGE_STRING ""
+#endif
+
+#ifndef PACKAGE_URL
+#define PACKAGE_URL ""
+#endif
+
+#ifndef PACKAGE_BUGREPORT
+#define PACKAGE_BUGREPORT ""
+#endif
+
+    if (!fPrintVersion.empty())
+    {
+        fPrintVersion(fName);
+        return;
+    }
+
+    std::string n = boost::filesystem::basename(fName);
+    if (n.substr(0, 3)=="lt-")
+        n = n.substr(3);
+
+    const string name = PACKAGE_STRING;
+    const string bugs = PACKAGE_BUGREPORT;
+    const string url  = PACKAGE_URL;
+
+    cout << n;
+    if (!name.empty())
+        cout << " - " << name;
+    cout <<
+        "\n\n"
+        "Written by Thomas Bretz et al.\n"
+        "\n";
+    if (!bugs.empty())
+        cout << "Report bugs to <" << bugs << ">\n";
+    if (!url.empty())
+        cout << "Home page: " << url << "\n";
+    cout <<
+        "\n"
+        "Copyright (C) 2011 by the FACT Collaboration.\n"
+        "This is free software; see the source for copying conditions.\n"
+        << std::endl;
+}
Index: trunk/FACT++/src/Configuration.h
===================================================================
--- trunk/FACT++/src/Configuration.h	(revision 10795)
+++ trunk/FACT++/src/Configuration.h	(revision 10796)
@@ -47,4 +47,5 @@
     boost::function<std::string(std::string)> fNameMapper;
     boost::function<void()>                   fPrintUsage;
+    boost::function<void(const std::string&)> fPrintVersion;
 
     /// Helper function which return the max of the two arguments in the first argument
@@ -61,4 +62,5 @@
 
     virtual void PrintUsage() const { }
+    virtual void PrintVersion() const;
 
 public:
@@ -89,4 +91,7 @@
     void SetPrintUsage(const boost::function<void(void)> &func);
     void SetPrintUsage();
+
+    void SetPrintVersion(const boost::function<void(const std::string &)> &func);
+    void SetPrintVersion();
 
     void AddEnv(const std::string &conf, const std::string &env)
