Index: code/branches/core6/src/libraries/core/CMakeLists.txt
===================================================================
--- code/branches/core6/src/libraries/core/CMakeLists.txt	(revision 9559)
+++ code/branches/core6/src/libraries/core/CMakeLists.txt	(revision 9560)
@@ -22,5 +22,4 @@
 #BUILD_UNIT CoreStableBuildUnit.cc
   ClassTreeMask.cc
-  CommandLineParser.cc
   DynLib.cc
   DynLibManager.cc
Index: code/branches/core6/src/libraries/core/CommandLineParser.cc
===================================================================
--- code/branches/core6/src/libraries/core/CommandLineParser.cc	(revision 9559)
+++ 	(revision )
@@ -1,340 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#include "CommandLineParser.h"
-
-#include <algorithm>
-#include <sstream>
-
-#include "util/Convert.h"
-#include "util/Output.h"
-#include "util/Exception.h"
-#include "util/StringUtils.h"
-#include "util/SubString.h"
-#include "PathConfig.h"
-
-namespace orxonox
-{
-    /**
-    @brief
-        Parses a value string for a command line argument.
-        It simply uses convertValue(Output, Input) to do that.
-        Bools are treated specially. That is necessary
-        so that you can have simple command line switches.
-    */
-    void CommandLineArgument::parse(const std::string& value)
-    {
-        if (value_.isType<bool>())
-        {
-            // simulate command line switch
-            bool temp;
-            if (convertValue(&temp, value))
-            {
-                this->bHasDefaultValue_ = false;
-                this->value_ = temp;
-            }
-            else if (value.empty())
-            {
-                this->bHasDefaultValue_ = false;
-                this->value_ = true;
-            }
-            else
-                ThrowException(Argument, "Could not read command line argument '" + getName() + "'.");
-        }
-        else
-        {
-            if (!value_.set(value))
-            {
-                value_.set(defaultValue_);
-                ThrowException(Argument, "Could not read command line argument '" + getName() + "'.");
-            }
-            else
-                this->bHasDefaultValue_ = false;
-        }
-    }
-
-
-    /**
-    @brief
-        Destructor destroys all CommandLineArguments with it.
-    */
-    CommandLineParser::~CommandLineParser()
-    {
-        CommandLineParser::destroyAllArguments();
-    }
-
-    /**
-    @brief
-        Returns a unique instance (Meyers Singleton).
-    */
-    CommandLineParser& CommandLineParser::_getInstance()
-    {
-        static CommandLineParser instance;
-        return instance;
-    }
-
-    /**
-    @brief
-        Destroys all command line arguments. This should be called at the end
-        of main. Do not use before that.
-    */
-    void CommandLineParser::destroyAllArguments()
-    {
-        for (std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.begin();
-            it != _getInstance().cmdLineArgs_.end(); ++it)
-            delete it->second;
-        _getInstance().cmdLineArgs_.clear();
-    }
-
-    /** Parses the command line string for arguments and stores these.
-    @note
-        The reason that you have to provide the string to be parsed as
-        space separated list is because of argc and argv. If you only have
-        a whole string, simply use getAllStrings() of SubString.
-    @param cmdLine
-        Command line string WITHOUT the execution path.
-    */
-    void CommandLineParser::_parse(const std::string& cmdLine)
-    {
-        std::vector<std::string> arguments;
-        SubString tokens(cmdLine, " ", " ", false, '\\', true, '"', true, '\0', '\0', false);
-        for (unsigned i = 0; i < tokens.size(); ++i)
-            arguments.push_back(tokens[i]);
-
-        try
-        {
-            // why this? See bFirstTimeParse_ declaration.
-            if (bFirstTimeParse_)
-            {
-                // first shove all the shortcuts in a map
-                for (std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgs_.begin();
-                    it != cmdLineArgs_.end(); ++it)
-                {
-                    OrxAssert(cmdLineArgsShortcut_.find(it->second->getShortcut()) == cmdLineArgsShortcut_.end(),
-                        "Cannot have two command line shortcut with the same name.");
-                    if (!it->second->getShortcut().empty())
-                        cmdLineArgsShortcut_[it->second->getShortcut()] = it->second;
-                }
-                bFirstTimeParse_ = false;
-            }
-
-            std::string name;
-            std::string shortcut;
-            std::string value;
-            for (unsigned int i = 0; i < arguments.size(); ++i)
-            {
-                if (arguments[i].size() != 0)
-                {
-                    // sure not ""
-                    if (arguments[i][0] == '-')
-                    {
-                        // start with "-"
-                        if (arguments[i].size() == 1)
-                        {
-                            // argument[i] is "-", probably a minus sign
-                            value += "- ";
-                        }
-                        else if (arguments[i][1] <= 57 && arguments[i][1] >= 48)
-                        {
-                            // negative number as a value
-                            value += arguments[i] + ' ';
-                        }
-                        else
-                        {
-                            // can be shortcut or full name argument
-
-                            // save old data first
-                            value = removeTrailingWhitespaces(value);
-                            if (!name.empty())
-                            {
-                                checkFullArgument(name, value);
-                                name.clear();
-                                assert(shortcut.empty());
-                            }
-                            else if (!shortcut.empty())
-                            {
-                                checkShortcut(shortcut, value);
-                                shortcut.clear();
-                                assert(name.empty());
-                            }
-
-                            if (arguments[i][1] == '-')
-                            {
-                                // full name argument with "--name"
-                                name = arguments[i].substr(2);
-                            }
-                            else
-                            {
-                                // shortcut with "-s"
-                                shortcut = arguments[i].substr(1);
-                            }
-
-                            // reset value string
-                            value.clear();
-                        }
-                    }
-                    else
-                    {
-                        // value string
-
-                        if (name.empty() && shortcut.empty())
-                        {
-                            ThrowException(Argument, "Expected \"-\" or \"-\" in command line arguments.\n");
-                        }
-
-                        // Concatenate strings as long as there's no new argument by "-" or "--"
-                        value += arguments[i] + ' ';
-                    }
-                }
-            }
-
-            // parse last argument
-            value = removeTrailingWhitespaces(value);
-            if (!name.empty())
-            {
-                checkFullArgument(name, value);
-                assert(shortcut.empty());
-            }
-            else if (!shortcut.empty())
-            {
-                checkShortcut(shortcut, value);
-                assert(name.empty());
-            }
-        }
-        catch (const ArgumentException& ex)
-        {
-            orxout(user_error) << "Could not parse command line: " << ex.what() << endl;
-            orxout(user_error) << CommandLineParser::getUsageInformation() << endl;
-            throw GeneralException("");
-        }
-    }
-
-    /**
-    @brief
-        Parses an argument based on its full name.
-    @param name
-        Full name of the argument
-    @param value
-        String containing the value
-    @param bParsingFile
-        Parsing a file or the command line itself
-    */
-    void CommandLineParser::checkFullArgument(const std::string& name, const std::string& value)
-    {
-        std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgs_.find(name);
-        if (it == cmdLineArgs_.end())
-            ThrowException(Argument, "Command line argument '" + name + "' does not exist.");
-
-        it->second->parse(value);
-    }
-
-    /**
-    @brief
-        Parses an argument based on its shortcut.
-    @param shortcut
-        Shortcut to the argument
-    @param value
-        String containing the value
-    @param bParsingFile
-        Parsing a file or the command line itself
-    */
-    void CommandLineParser::checkShortcut(const std::string& shortcut, const std::string& value)
-    {
-        std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgsShortcut_.find(shortcut);
-        if (it == cmdLineArgsShortcut_.end())
-            ThrowException(Argument, "Command line shortcut '" + shortcut + "' does not exist.");
-
-        it->second->parse(value);
-    }
-
-    std::string CommandLineParser::getUsageInformation()
-    {
-        CommandLineParser& inst = _getInstance();
-        std::ostringstream infoStr;
-
-        // determine maximum name size
-        size_t maxNameSize = 0;
-        for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst.cmdLineArgs_.begin();
-            it != inst.cmdLineArgs_.end(); ++it)
-        {
-            maxNameSize = std::max(it->second->getName().size(), maxNameSize);
-        }
-
-        infoStr << endl;
-        infoStr << "Usage: orxonox [options]" << endl;
-        infoStr << "Available options:" << endl;
-
-        for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst.cmdLineArgs_.begin();
-            it != inst.cmdLineArgs_.end(); ++it)
-        {
-            if (!it->second->getShortcut().empty())
-                infoStr << " [-" << it->second->getShortcut() << "] ";
-            else
-                infoStr << "      ";
-            infoStr << "--" << it->second->getName() << ' ';
-            if (it->second->getValue().isType<bool>())
-                infoStr << "    ";
-            else
-                infoStr << "ARG ";
-            // fill with the necessary amount of blanks
-            infoStr << std::string(maxNameSize - it->second->getName().size(), ' ');
-            infoStr << ": " << it->second->getInformation();
-            infoStr << endl;
-        }
-        return infoStr.str();
-    }
-
-    void CommandLineParser::generateDoc(std::ofstream& file)
-    {
-        file << "/** @page cmdargspage Command Line Arguments Reference" << endl;
-        file << "    @verbatim"; /*no endl*/
-        file << getUsageInformation(); /*no endl*/
-        file << "    @endverbatim" << endl;
-        file << "*/" << endl;
-    }
-
-    /**
-    @brief
-        Retrieves a CommandLineArgument.
-        The method throws an exception if 'name' was not found or the value could not be converted.
-    @note
-        You should of course not call this method before the command line has been parsed.
-    */
-    const CommandLineArgument* CommandLineParser::getArgument(const std::string& name)
-    {
-        std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name);
-        if (it == _getInstance().cmdLineArgs_.end())
-        {
-            ThrowException(Argument, "Could find command line argument '" + name + "'.");
-        }
-        else
-        {
-            return it->second;
-        }
-    }
-}
Index: code/branches/core6/src/libraries/core/CommandLineParser.h
===================================================================
--- code/branches/core6/src/libraries/core/CommandLineParser.h	(revision 9559)
+++ 	(revision )
@@ -1,227 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @defgroup CmdArgs Commandline arguments
-    @ingroup Config
-    @brief For a reference of all commandline arguments see @ref cmdargspage
-*/
-
-/**
-    @file
-    @ingroup Config CmdArgs
-    @brief Declaration of CommandLineParser and CommandLineArgument, definition of the SetCommandLineArgument() macros.
-*/
-
-#ifndef _CommandLine_H__
-#define _CommandLine_H__
-
-#include "CorePrereqs.h"
-
-#include <fstream>
-#include <map>
-#include "util/OrxAssert.h"
-#include "util/MultiType.h"
-
-#define SetCommandLineArgument(name, defaultValue) \
-    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
-    = orxonox::CommandLineParser::addArgument(#name, defaultValue)
-#define SetCommandLineSwitch(name) \
-    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
-    = orxonox::CommandLineParser::addArgument(#name, false)
-
-namespace orxonox
-{
-    /**
-    @brief
-        Container class for a command line argument of any type supported by MultiType.
-
-        Whenever you want to have an option specified by a command line switch,
-        you need to first define it with SetCommandLineArgument(name, defaultValue).
-        It is then added to a map and possibly changed when the command line is being parsed.
-        If the option was not given, you can detect this by asking hasDefaultValue().
-
-        There is a possibility to define a short cut so you can write "-p 20" instead of "--port 20".
-        Note the difference between "-" and "--"!
-        Also, there is no restriction to the number of strings you add after --name.
-        So "--startVector {2, 4, 5}" is perfectly legal.
-
-        Retrieving an argument is possible with the getCommandLineArgument function of the
-        CommandLineParser class. It is a Singleton, but the public interface is static.
-    */
-    class _CoreExport CommandLineArgument
-    {
-        friend class CommandLineParser;
-
-    public:
-        //! Tells whether the value has been changed by the command line.
-        bool hasDefaultValue() const { return bHasDefaultValue_; }
-        //! Returns the name of the argument.
-        const std::string& getName() const { return name_; }
-
-        //! Returns the shortcut (example: "-p 22" for "--port 22") of the argument.
-        //! Evaluates to "" if there is none.
-        const std::string& getShortcut() const { return shortcut_; }
-        //! Sets the shortcut for the argument
-        CommandLineArgument& shortcut(const std::string& shortcut)
-        { this->shortcut_ = shortcut; return *this; }
-
-        //! Returns the usage information
-        const std::string& getInformation() const { return this->usageInformation_; }
-        //! Sets the option information when displaying orxonox usage.
-        CommandLineArgument& information(const std::string& usage)
-        { this->usageInformation_ = usage; return *this; }
-
-        //! Returns the actual value of the argument. Can be equal to default value.
-        const MultiType& getValue() const { return value_; }
-        //! Returns the given default value as type T.
-        const MultiType& getDefaultValue() const { return defaultValue_; }
-
-    private:
-        //! Constructor initialises both value_ and defaultValue_ with defaultValue.
-        CommandLineArgument(const std::string& name, const MultiType& defaultValue)
-            : bHasDefaultValue_(true)
-            , name_(name)
-            , value_(defaultValue)
-            , defaultValue_(defaultValue)
-        { }
-
-        //! Undefined copy constructor
-        CommandLineArgument(const CommandLineArgument& instance);
-        ~CommandLineArgument() { }
-
-        //! Parses the value string of a command line argument.
-        void parse(const std::string& value);
-
-        //! Tells whether the value has been changed by the command line.
-        bool bHasDefaultValue_;
-
-    private:
-        std::string name_;             //!< Name of the argument
-        std::string shortcut_;         //!< Shortcut of the argument. @see getShortcut().
-        std::string usageInformation_; //!< Tells about the usage of this parameter
-
-        MultiType   value_;            //!< The actual value
-        MultiType   defaultValue_;     //!< Default value. Should not be changed.
-    };
-
-
-    /**
-    @brief
-        Global interface to command line options.
-        Allows to add and retrieve command line arguments. Also does the parsing.
-    @note
-        Internally it is a Singleton, but the public interface is static.
-    @see
-        CommandLineArgument
-    */
-    class _CoreExport CommandLineParser
-    {
-    public:
-
-        //! Parse redirection to internal member method.
-        static void parse(const std::string& cmdLine)
-        { _getInstance()._parse(cmdLine); }
-
-        static std::string getUsageInformation();
-
-        static const CommandLineArgument* getArgument(const std::string& name);
-        //! Writes the argument value in the given parameter.
-        template <class T>
-        static void getValue(const std::string& name, T* value)
-        { *value = (T)(getArgument(name)->getValue()); }
-        static const MultiType& getValue(const std::string& name)
-        { return getArgument(name)->getValue(); }
-        template <class T>
-        static CommandLineArgument& addArgument(const std::string& name, T defaultValue);
-
-        static bool existsArgument(const std::string& name)
-        {
-            std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name);
-            return !(it == _getInstance().cmdLineArgs_.end());
-        }
-
-        static void destroyAllArguments();
-
-        static void generateDoc(std::ofstream& file);
-
-    private:
-        //! Constructor initialises bFirstTimeParse_ with true.
-        CommandLineParser() : bFirstTimeParse_(true) { }
-        //! Undefined copy constructor
-        CommandLineParser(const CommandLineParser& instance);
-        ~CommandLineParser();
-
-        static CommandLineParser& _getInstance();
-
-        void _parse(const std::string& cmdLine);
-        void checkFullArgument(const std::string& name, const std::string& value);
-        void checkShortcut(const std::string& shortcut, const std::string& value);
-
-        /**
-            Tells whether we parsed for the first time. The CommmandLineArguments are added before main().
-            So when we call parse() the first time, we need to create a map with all shortcuts since these
-            get added after addCommandLineArgument().
-        */
-        bool bFirstTimeParse_;
-
-        //! Holds all pointers to the arguments and serves as a search map by name.
-        std::map<std::string, CommandLineArgument*> cmdLineArgs_;
-        //! Search map by shortcut for the arguments.
-        std::map<std::string, CommandLineArgument*> cmdLineArgsShortcut_;
-    };
-
-    template <>
-    inline void CommandLineParser::getValue<std::string>(const std::string& name, std::string* value)
-    {
-        *value = getArgument(name)->getValue().get<std::string>();
-    }
-
-    /**
-    @brief
-        Adds a new CommandLineArgument to the internal map.
-        Note that only such arguments are actually valid.
-    @param name
-        Name of the argument. Shortcut can be added later.
-    @param defaultValue
-        Default value that is used when argument was not given.
-    */
-    template <class T>
-    CommandLineArgument& CommandLineParser::addArgument(const std::string& name, T defaultValue)
-    {
-        OrxAssert(!_getInstance().existsArgument(name),
-            "Cannot add a command line argument with name '" + name + "' twice.");
-        OrxAssert(!MultiType(defaultValue).isType<bool>() || MultiType(defaultValue).get<bool>() != true,
-               "Boolean command line arguments with positive default values are not supported." << endl
-            << "Please use SetCommandLineSwitch and adjust your argument: " << name);
-
-        return *(_getInstance().cmdLineArgs_[name] = new CommandLineArgument(name, defaultValue));
-    }
-}
-
-#endif /* _CommandLine_H__ */
Index: code/branches/core6/src/libraries/core/Core.cc
===================================================================
--- code/branches/core6/src/libraries/core/Core.cc	(revision 9559)
+++ code/branches/core6/src/libraries/core/Core.cc	(revision 9560)
@@ -60,5 +60,5 @@
 #include "util/SignalHandler.h"
 #include "PathConfig.h"
-#include "CommandLineParser.h"
+#include "config/CommandLineParser.h"
 #include "config/ConfigFileManager.h"
 #include "config/ConfigValueIncludes.h"
Index: code/branches/core6/src/libraries/core/Game.cc
===================================================================
--- code/branches/core6/src/libraries/core/Game.cc	(revision 9559)
+++ code/branches/core6/src/libraries/core/Game.cc	(revision 9560)
@@ -44,7 +44,7 @@
 #include "util/Sleep.h"
 #include "util/SubString.h"
-#include "CommandLineParser.h"
 #include "Core.h"
 #include "CoreIncludes.h"
+#include "config/CommandLineParser.h"
 #include "config/ConfigValueIncludes.h"
 #include "GameMode.h"
Index: code/branches/core6/src/libraries/core/PathConfig.cc
===================================================================
--- code/branches/core6/src/libraries/core/PathConfig.cc	(revision 9559)
+++ code/branches/core6/src/libraries/core/PathConfig.cc	(revision 9560)
@@ -53,5 +53,5 @@
 #include "util/Output.h"
 #include "util/Exception.h"
-#include "CommandLineParser.h"
+#include "config/CommandLineParser.h"
 
 // Differentiate Boost Filesystem v2 and v3
Index: code/branches/core6/src/libraries/core/config/CMakeLists.txt
===================================================================
--- code/branches/core6/src/libraries/core/config/CMakeLists.txt	(revision 9559)
+++ code/branches/core6/src/libraries/core/config/CMakeLists.txt	(revision 9560)
@@ -1,3 +1,4 @@
 ADD_SOURCE_FILES(CORE_SRC_FILES
+  CommandLineParser.cc
 #  ConfigFile.cc is already included in FilesystemBuildUnit.cc
   ConfigFileEntryValue.cc
Index: code/branches/core6/src/libraries/core/config/CommandLineParser.cc
===================================================================
--- code/branches/core6/src/libraries/core/config/CommandLineParser.cc	(revision 9560)
+++ code/branches/core6/src/libraries/core/config/CommandLineParser.cc	(revision 9560)
@@ -0,0 +1,340 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "CommandLineParser.h"
+
+#include <algorithm>
+#include <sstream>
+
+#include "util/Convert.h"
+#include "util/Output.h"
+#include "util/Exception.h"
+#include "util/StringUtils.h"
+#include "util/SubString.h"
+#include "core/PathConfig.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        Parses a value string for a command line argument.
+        It simply uses convertValue(Output, Input) to do that.
+        Bools are treated specially. That is necessary
+        so that you can have simple command line switches.
+    */
+    void CommandLineArgument::parse(const std::string& value)
+    {
+        if (value_.isType<bool>())
+        {
+            // simulate command line switch
+            bool temp;
+            if (convertValue(&temp, value))
+            {
+                this->bHasDefaultValue_ = false;
+                this->value_ = temp;
+            }
+            else if (value.empty())
+            {
+                this->bHasDefaultValue_ = false;
+                this->value_ = true;
+            }
+            else
+                ThrowException(Argument, "Could not read command line argument '" + getName() + "'.");
+        }
+        else
+        {
+            if (!value_.set(value))
+            {
+                value_.set(defaultValue_);
+                ThrowException(Argument, "Could not read command line argument '" + getName() + "'.");
+            }
+            else
+                this->bHasDefaultValue_ = false;
+        }
+    }
+
+
+    /**
+    @brief
+        Destructor destroys all CommandLineArguments with it.
+    */
+    CommandLineParser::~CommandLineParser()
+    {
+        CommandLineParser::destroyAllArguments();
+    }
+
+    /**
+    @brief
+        Returns a unique instance (Meyers Singleton).
+    */
+    CommandLineParser& CommandLineParser::_getInstance()
+    {
+        static CommandLineParser instance;
+        return instance;
+    }
+
+    /**
+    @brief
+        Destroys all command line arguments. This should be called at the end
+        of main. Do not use before that.
+    */
+    void CommandLineParser::destroyAllArguments()
+    {
+        for (std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.begin();
+            it != _getInstance().cmdLineArgs_.end(); ++it)
+            delete it->second;
+        _getInstance().cmdLineArgs_.clear();
+    }
+
+    /** Parses the command line string for arguments and stores these.
+    @note
+        The reason that you have to provide the string to be parsed as
+        space separated list is because of argc and argv. If you only have
+        a whole string, simply use getAllStrings() of SubString.
+    @param cmdLine
+        Command line string WITHOUT the execution path.
+    */
+    void CommandLineParser::_parse(const std::string& cmdLine)
+    {
+        std::vector<std::string> arguments;
+        SubString tokens(cmdLine, " ", " ", false, '\\', true, '"', true, '\0', '\0', false);
+        for (unsigned i = 0; i < tokens.size(); ++i)
+            arguments.push_back(tokens[i]);
+
+        try
+        {
+            // why this? See bFirstTimeParse_ declaration.
+            if (bFirstTimeParse_)
+            {
+                // first shove all the shortcuts in a map
+                for (std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgs_.begin();
+                    it != cmdLineArgs_.end(); ++it)
+                {
+                    OrxAssert(cmdLineArgsShortcut_.find(it->second->getShortcut()) == cmdLineArgsShortcut_.end(),
+                        "Cannot have two command line shortcut with the same name.");
+                    if (!it->second->getShortcut().empty())
+                        cmdLineArgsShortcut_[it->second->getShortcut()] = it->second;
+                }
+                bFirstTimeParse_ = false;
+            }
+
+            std::string name;
+            std::string shortcut;
+            std::string value;
+            for (unsigned int i = 0; i < arguments.size(); ++i)
+            {
+                if (arguments[i].size() != 0)
+                {
+                    // sure not ""
+                    if (arguments[i][0] == '-')
+                    {
+                        // start with "-"
+                        if (arguments[i].size() == 1)
+                        {
+                            // argument[i] is "-", probably a minus sign
+                            value += "- ";
+                        }
+                        else if (arguments[i][1] <= 57 && arguments[i][1] >= 48)
+                        {
+                            // negative number as a value
+                            value += arguments[i] + ' ';
+                        }
+                        else
+                        {
+                            // can be shortcut or full name argument
+
+                            // save old data first
+                            value = removeTrailingWhitespaces(value);
+                            if (!name.empty())
+                            {
+                                checkFullArgument(name, value);
+                                name.clear();
+                                assert(shortcut.empty());
+                            }
+                            else if (!shortcut.empty())
+                            {
+                                checkShortcut(shortcut, value);
+                                shortcut.clear();
+                                assert(name.empty());
+                            }
+
+                            if (arguments[i][1] == '-')
+                            {
+                                // full name argument with "--name"
+                                name = arguments[i].substr(2);
+                            }
+                            else
+                            {
+                                // shortcut with "-s"
+                                shortcut = arguments[i].substr(1);
+                            }
+
+                            // reset value string
+                            value.clear();
+                        }
+                    }
+                    else
+                    {
+                        // value string
+
+                        if (name.empty() && shortcut.empty())
+                        {
+                            ThrowException(Argument, "Expected \"-\" or \"-\" in command line arguments.\n");
+                        }
+
+                        // Concatenate strings as long as there's no new argument by "-" or "--"
+                        value += arguments[i] + ' ';
+                    }
+                }
+            }
+
+            // parse last argument
+            value = removeTrailingWhitespaces(value);
+            if (!name.empty())
+            {
+                checkFullArgument(name, value);
+                assert(shortcut.empty());
+            }
+            else if (!shortcut.empty())
+            {
+                checkShortcut(shortcut, value);
+                assert(name.empty());
+            }
+        }
+        catch (const ArgumentException& ex)
+        {
+            orxout(user_error) << "Could not parse command line: " << ex.what() << endl;
+            orxout(user_error) << CommandLineParser::getUsageInformation() << endl;
+            throw GeneralException("");
+        }
+    }
+
+    /**
+    @brief
+        Parses an argument based on its full name.
+    @param name
+        Full name of the argument
+    @param value
+        String containing the value
+    @param bParsingFile
+        Parsing a file or the command line itself
+    */
+    void CommandLineParser::checkFullArgument(const std::string& name, const std::string& value)
+    {
+        std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgs_.find(name);
+        if (it == cmdLineArgs_.end())
+            ThrowException(Argument, "Command line argument '" + name + "' does not exist.");
+
+        it->second->parse(value);
+    }
+
+    /**
+    @brief
+        Parses an argument based on its shortcut.
+    @param shortcut
+        Shortcut to the argument
+    @param value
+        String containing the value
+    @param bParsingFile
+        Parsing a file or the command line itself
+    */
+    void CommandLineParser::checkShortcut(const std::string& shortcut, const std::string& value)
+    {
+        std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgsShortcut_.find(shortcut);
+        if (it == cmdLineArgsShortcut_.end())
+            ThrowException(Argument, "Command line shortcut '" + shortcut + "' does not exist.");
+
+        it->second->parse(value);
+    }
+
+    std::string CommandLineParser::getUsageInformation()
+    {
+        CommandLineParser& inst = _getInstance();
+        std::ostringstream infoStr;
+
+        // determine maximum name size
+        size_t maxNameSize = 0;
+        for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst.cmdLineArgs_.begin();
+            it != inst.cmdLineArgs_.end(); ++it)
+        {
+            maxNameSize = std::max(it->second->getName().size(), maxNameSize);
+        }
+
+        infoStr << endl;
+        infoStr << "Usage: orxonox [options]" << endl;
+        infoStr << "Available options:" << endl;
+
+        for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst.cmdLineArgs_.begin();
+            it != inst.cmdLineArgs_.end(); ++it)
+        {
+            if (!it->second->getShortcut().empty())
+                infoStr << " [-" << it->second->getShortcut() << "] ";
+            else
+                infoStr << "      ";
+            infoStr << "--" << it->second->getName() << ' ';
+            if (it->second->getValue().isType<bool>())
+                infoStr << "    ";
+            else
+                infoStr << "ARG ";
+            // fill with the necessary amount of blanks
+            infoStr << std::string(maxNameSize - it->second->getName().size(), ' ');
+            infoStr << ": " << it->second->getInformation();
+            infoStr << endl;
+        }
+        return infoStr.str();
+    }
+
+    void CommandLineParser::generateDoc(std::ofstream& file)
+    {
+        file << "/** @page cmdargspage Command Line Arguments Reference" << endl;
+        file << "    @verbatim"; /*no endl*/
+        file << getUsageInformation(); /*no endl*/
+        file << "    @endverbatim" << endl;
+        file << "*/" << endl;
+    }
+
+    /**
+    @brief
+        Retrieves a CommandLineArgument.
+        The method throws an exception if 'name' was not found or the value could not be converted.
+    @note
+        You should of course not call this method before the command line has been parsed.
+    */
+    const CommandLineArgument* CommandLineParser::getArgument(const std::string& name)
+    {
+        std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name);
+        if (it == _getInstance().cmdLineArgs_.end())
+        {
+            ThrowException(Argument, "Could find command line argument '" + name + "'.");
+        }
+        else
+        {
+            return it->second;
+        }
+    }
+}
Index: code/branches/core6/src/libraries/core/config/CommandLineParser.h
===================================================================
--- code/branches/core6/src/libraries/core/config/CommandLineParser.h	(revision 9560)
+++ code/branches/core6/src/libraries/core/config/CommandLineParser.h	(revision 9560)
@@ -0,0 +1,227 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @defgroup CmdArgs Commandline arguments
+    @ingroup Config
+    @brief For a reference of all commandline arguments see @ref cmdargspage
+*/
+
+/**
+    @file
+    @ingroup Config CmdArgs
+    @brief Declaration of CommandLineParser and CommandLineArgument, definition of the SetCommandLineArgument() macros.
+*/
+
+#ifndef _CommandLine_H__
+#define _CommandLine_H__
+
+#include "core/CorePrereqs.h"
+
+#include <fstream>
+#include <map>
+#include "util/OrxAssert.h"
+#include "util/MultiType.h"
+
+#define SetCommandLineArgument(name, defaultValue) \
+    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
+    = orxonox::CommandLineParser::addArgument(#name, defaultValue)
+#define SetCommandLineSwitch(name) \
+    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
+    = orxonox::CommandLineParser::addArgument(#name, false)
+
+namespace orxonox
+{
+    /**
+    @brief
+        Container class for a command line argument of any type supported by MultiType.
+
+        Whenever you want to have an option specified by a command line switch,
+        you need to first define it with SetCommandLineArgument(name, defaultValue).
+        It is then added to a map and possibly changed when the command line is being parsed.
+        If the option was not given, you can detect this by asking hasDefaultValue().
+
+        There is a possibility to define a short cut so you can write "-p 20" instead of "--port 20".
+        Note the difference between "-" and "--"!
+        Also, there is no restriction to the number of strings you add after --name.
+        So "--startVector {2, 4, 5}" is perfectly legal.
+
+        Retrieving an argument is possible with the getCommandLineArgument function of the
+        CommandLineParser class. It is a Singleton, but the public interface is static.
+    */
+    class _CoreExport CommandLineArgument
+    {
+        friend class CommandLineParser;
+
+    public:
+        //! Tells whether the value has been changed by the command line.
+        bool hasDefaultValue() const { return bHasDefaultValue_; }
+        //! Returns the name of the argument.
+        const std::string& getName() const { return name_; }
+
+        //! Returns the shortcut (example: "-p 22" for "--port 22") of the argument.
+        //! Evaluates to "" if there is none.
+        const std::string& getShortcut() const { return shortcut_; }
+        //! Sets the shortcut for the argument
+        CommandLineArgument& shortcut(const std::string& shortcut)
+        { this->shortcut_ = shortcut; return *this; }
+
+        //! Returns the usage information
+        const std::string& getInformation() const { return this->usageInformation_; }
+        //! Sets the option information when displaying orxonox usage.
+        CommandLineArgument& information(const std::string& usage)
+        { this->usageInformation_ = usage; return *this; }
+
+        //! Returns the actual value of the argument. Can be equal to default value.
+        const MultiType& getValue() const { return value_; }
+        //! Returns the given default value as type T.
+        const MultiType& getDefaultValue() const { return defaultValue_; }
+
+    private:
+        //! Constructor initialises both value_ and defaultValue_ with defaultValue.
+        CommandLineArgument(const std::string& name, const MultiType& defaultValue)
+            : bHasDefaultValue_(true)
+            , name_(name)
+            , value_(defaultValue)
+            , defaultValue_(defaultValue)
+        { }
+
+        //! Undefined copy constructor
+        CommandLineArgument(const CommandLineArgument& instance);
+        ~CommandLineArgument() { }
+
+        //! Parses the value string of a command line argument.
+        void parse(const std::string& value);
+
+        //! Tells whether the value has been changed by the command line.
+        bool bHasDefaultValue_;
+
+    private:
+        std::string name_;             //!< Name of the argument
+        std::string shortcut_;         //!< Shortcut of the argument. @see getShortcut().
+        std::string usageInformation_; //!< Tells about the usage of this parameter
+
+        MultiType   value_;            //!< The actual value
+        MultiType   defaultValue_;     //!< Default value. Should not be changed.
+    };
+
+
+    /**
+    @brief
+        Global interface to command line options.
+        Allows to add and retrieve command line arguments. Also does the parsing.
+    @note
+        Internally it is a Singleton, but the public interface is static.
+    @see
+        CommandLineArgument
+    */
+    class _CoreExport CommandLineParser
+    {
+    public:
+
+        //! Parse redirection to internal member method.
+        static void parse(const std::string& cmdLine)
+        { _getInstance()._parse(cmdLine); }
+
+        static std::string getUsageInformation();
+
+        static const CommandLineArgument* getArgument(const std::string& name);
+        //! Writes the argument value in the given parameter.
+        template <class T>
+        static void getValue(const std::string& name, T* value)
+        { *value = (T)(getArgument(name)->getValue()); }
+        static const MultiType& getValue(const std::string& name)
+        { return getArgument(name)->getValue(); }
+        template <class T>
+        static CommandLineArgument& addArgument(const std::string& name, T defaultValue);
+
+        static bool existsArgument(const std::string& name)
+        {
+            std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name);
+            return !(it == _getInstance().cmdLineArgs_.end());
+        }
+
+        static void destroyAllArguments();
+
+        static void generateDoc(std::ofstream& file);
+
+    private:
+        //! Constructor initialises bFirstTimeParse_ with true.
+        CommandLineParser() : bFirstTimeParse_(true) { }
+        //! Undefined copy constructor
+        CommandLineParser(const CommandLineParser& instance);
+        ~CommandLineParser();
+
+        static CommandLineParser& _getInstance();
+
+        void _parse(const std::string& cmdLine);
+        void checkFullArgument(const std::string& name, const std::string& value);
+        void checkShortcut(const std::string& shortcut, const std::string& value);
+
+        /**
+            Tells whether we parsed for the first time. The CommmandLineArguments are added before main().
+            So when we call parse() the first time, we need to create a map with all shortcuts since these
+            get added after addCommandLineArgument().
+        */
+        bool bFirstTimeParse_;
+
+        //! Holds all pointers to the arguments and serves as a search map by name.
+        std::map<std::string, CommandLineArgument*> cmdLineArgs_;
+        //! Search map by shortcut for the arguments.
+        std::map<std::string, CommandLineArgument*> cmdLineArgsShortcut_;
+    };
+
+    template <>
+    inline void CommandLineParser::getValue<std::string>(const std::string& name, std::string* value)
+    {
+        *value = getArgument(name)->getValue().get<std::string>();
+    }
+
+    /**
+    @brief
+        Adds a new CommandLineArgument to the internal map.
+        Note that only such arguments are actually valid.
+    @param name
+        Name of the argument. Shortcut can be added later.
+    @param defaultValue
+        Default value that is used when argument was not given.
+    */
+    template <class T>
+    CommandLineArgument& CommandLineParser::addArgument(const std::string& name, T defaultValue)
+    {
+        OrxAssert(!_getInstance().existsArgument(name),
+            "Cannot add a command line argument with name '" + name + "' twice.");
+        OrxAssert(!MultiType(defaultValue).isType<bool>() || MultiType(defaultValue).get<bool>() != true,
+               "Boolean command line arguments with positive default values are not supported." << endl
+            << "Please use SetCommandLineSwitch and adjust your argument: " << name);
+
+        return *(_getInstance().cmdLineArgs_[name] = new CommandLineArgument(name, defaultValue));
+    }
+}
+
+#endif /* _CommandLine_H__ */
Index: code/branches/core6/src/libraries/core/input/InputManager.cc
===================================================================
--- code/branches/core6/src/libraries/core/input/InputManager.cc	(revision 9559)
+++ code/branches/core6/src/libraries/core/input/InputManager.cc	(revision 9560)
@@ -46,7 +46,7 @@
 #include "util/Exception.h"
 #include "core/CoreIncludes.h"
+#include "core/GraphicsManager.h"
 #include "core/config/ConfigValueIncludes.h"
-#include "core/CommandLineParser.h"
-#include "core/GraphicsManager.h"
+#include "core/config/CommandLineParser.h"
 #include "core/command/ConsoleCommand.h"
 #include "core/command/Functor.h"
Index: code/branches/core6/src/libraries/network/Client.cc
===================================================================
--- code/branches/core6/src/libraries/network/Client.cc	(revision 9559)
+++ code/branches/core6/src/libraries/network/Client.cc	(revision 9560)
@@ -51,6 +51,6 @@
 #include "FunctionCallManager.h"
 #include "core/CoreIncludes.h"
-#include "core/CommandLineParser.h"
 #include "core/Game.h"
+#include "core/config/CommandLineParser.h"
 
 namespace orxonox
