Index: code/branches/doc/src/libraries/core/CommandLineParser.cc
===================================================================
--- code/branches/doc/src/libraries/core/CommandLineParser.cc	(revision 7353)
+++ code/branches/doc/src/libraries/core/CommandLineParser.cc	(revision 7357)
@@ -41,5 +41,4 @@
 namespace orxonox
 {
-    //! @cmdarg
     SetCommandLineOnlyArgument(optionsFile, "start.ini").shortcut("o");
 
@@ -315,4 +314,13 @@
     }
 
+    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
@@ -320,5 +328,5 @@
         The method throws an exception if 'name' was not found or the value could not be converted.
     @note
-        You shold of course not call this method before the command line has been parsed.
+        You should of course not call this method before the command line has been parsed.
     */
     const CommandLineArgument* CommandLineParser::getArgument(const std::string& name)
Index: code/branches/doc/src/libraries/core/CommandLineParser.h
===================================================================
--- code/branches/doc/src/libraries/core/CommandLineParser.h	(revision 7353)
+++ code/branches/doc/src/libraries/core/CommandLineParser.h	(revision 7357)
@@ -32,4 +32,5 @@
 #include "CorePrereqs.h"
 
+#include <fstream>
 #include <map>
 #include "util/OrxAssert.h"
@@ -164,4 +165,6 @@
 
         static void destroyAllArguments();
+
+        static void generateDoc(std::ofstream& file);
 
     private:
Index: code/branches/doc/src/libraries/core/Core.cc
===================================================================
--- code/branches/doc/src/libraries/core/Core.cc	(revision 7353)
+++ code/branches/doc/src/libraries/core/Core.cc	(revision 7357)
@@ -37,4 +37,5 @@
 
 #include <cassert>
+#include <fstream>
 #include <vector>
 
@@ -77,11 +78,8 @@
     Core* Core::singletonPtr_s  = 0;
 
-    //! @cmdarg
     SetCommandLineArgument(settingsFile, "orxonox.ini").information("THE configuration file");
-    //! @cmdarg
     SetCommandLineSwitch(noIOConsole).information("Use this if you don't want to use the IOConsole (for instance for Lua debugging)");
 
 #ifdef ORXONOX_PLATFORM_WINDOWS
-    //! @cmdarg
     SetCommandLineArgument(limitToCPU, 1).information("Limits the program to one CPU/core (1, 2, 3, etc.). Default is the first core (faster than off)");
 #endif
@@ -174,4 +172,19 @@
         // Create singletons that always exist (in other libraries)
         this->rootScope_.reset(new Scope<ScopeID::Root>());
+
+        // Generate documentation instead of normal run?
+        std::string docFilename;
+        CommandLineParser::getValue("generateDoc", &docFilename);
+        if (!docFilename.empty())
+        {
+            std::ofstream docFile(docFilename.c_str());
+            if (docFile.is_open())
+            {
+                CommandLineParser::generateDoc(docFile);
+                docFile.close();
+            }
+            else
+                COUT(0) << "Error: Could not open file for documentation writing" << endl;
+        }
     }
 
Index: code/branches/doc/src/libraries/core/Core.h
===================================================================
--- code/branches/doc/src/libraries/core/Core.h	(revision 7353)
+++ code/branches/doc/src/libraries/core/Core.h	(revision 7357)
@@ -33,5 +33,4 @@
 #include "CorePrereqs.h"
 
-#include <cassert>
 #include <string>
 #include <boost/scoped_ptr.hpp>
Index: code/branches/doc/src/libraries/core/PathConfig.cc
===================================================================
--- code/branches/doc/src/libraries/core/PathConfig.cc	(revision 7353)
+++ code/branches/doc/src/libraries/core/PathConfig.cc	(revision 7357)
@@ -70,7 +70,5 @@
     PathConfig* PathConfig::singletonPtr_s  = 0;
 
-    //! @cmdarg
     SetCommandLineArgument(externalDataPath, "").information("Path to the external data files");
-    //! @cmdarg
     SetCommandLineOnlyArgument(writingPathSuffix, "").information("Additional subfolder for config and log files");
 
Index: code/branches/doc/src/libraries/core/input/InputManager.cc
===================================================================
--- code/branches/doc/src/libraries/core/input/InputManager.cc	(revision 7353)
+++ code/branches/doc/src/libraries/core/input/InputManager.cc	(revision 7357)
@@ -60,5 +60,4 @@
 namespace orxonox
 {
-    //! @cmdarg
     SetCommandLineSwitch(keyboard_no_grab).information("Whether not to exclusively grab the keyboard");
 
Index: code/branches/doc/src/orxonox/LevelManager.cc
===================================================================
--- code/branches/doc/src/orxonox/LevelManager.cc	(revision 7353)
+++ code/branches/doc/src/orxonox/LevelManager.cc	(revision 7357)
@@ -42,5 +42,4 @@
 namespace orxonox
 {
-    //! @cmdarg
     SetCommandLineArgument(level, "").shortcut("l").information("Default level file (overrides LevelManager::defaultLevelName_ configValue)");
 
Index: code/branches/doc/src/orxonox/Main.cc
===================================================================
--- code/branches/doc/src/orxonox/Main.cc	(revision 7353)
+++ code/branches/doc/src/orxonox/Main.cc	(revision 7357)
@@ -48,23 +48,13 @@
 namespace orxonox
 {
-    //! @cmdarg
     SetCommandLineSwitch(console).information("Start in console mode (text IO only)");
-    //! @cmdarg
     SetCommandLineSwitch(server).information("Start in server mode");
-    //! @cmdarg
     SetCommandLineSwitch(client).information("Start in client mode");
-    //! @cmdarg
     SetCommandLineSwitch(dedicated).information("Start in dedicated server mode");
-    //! @cmdarg
     SetCommandLineSwitch(standalone).information("Start in standalone mode");
-    //! @cmdarg
     SetCommandLineSwitch(dedicatedClient).information("Start in dedicated client mode");
 
-    //! @cmdarg
-    SetCommandLineSwitch(generateDoc)
+    SetCommandLineArgument(generateDoc, "")
         .information("Generates a Doxygen file from things like SetConsoleCommand");
-    //! @cmdarg
-    SetCommandLineArgument(docFile, "Internal.dox")
-        .information("Name of the doc file to be generated with --generateDoc");
 
     /**
@@ -76,11 +66,5 @@
         Game* game = new Game(strCmdLine);
 
-        if (CommandLineParser::getValue("generateDoc").getBool())
-        {
-            // Generate additional documentation written to ONE file
-            std::string filename;
-            CommandLineParser::getValue("docFile", &filename);
-        }
-        else
+        if (CommandLineParser::getValue("generateDoc").getString().empty())
         {
             game->setStateHierarchy(
@@ -96,5 +80,5 @@
             game->requestState("root");
 
-            // Some development hacks (not really, but in the future, this calls won't make sense anymore)
+            // Some development hacks (not really, but in the future, these calls won't make sense anymore)
             if (CommandLineParser::getValue("standalone").getBool())
                 Game::getInstance().requestStates("graphics, standalone, level");
Index: code/branches/doc/src/orxonox/gamestates/GSClient.cc
===================================================================
--- code/branches/doc/src/orxonox/gamestates/GSClient.cc	(revision 7353)
+++ code/branches/doc/src/orxonox/gamestates/GSClient.cc	(revision 7357)
@@ -40,5 +40,4 @@
     DeclareGameState(GSClient, "client", false, false);
 
-    //! @cmdarg
     SetCommandLineArgument(dest, "127.0.0.1").information("Server hostname/IP (IP in the form of #.#.#.#)");
 
Index: code/branches/doc/src/orxonox/gamestates/GSServer.cc
===================================================================
--- code/branches/doc/src/orxonox/gamestates/GSServer.cc	(revision 7353)
+++ code/branches/doc/src/orxonox/gamestates/GSServer.cc	(revision 7357)
@@ -39,5 +39,4 @@
     DeclareGameState(GSServer, "server", false, false);
 
-    //! @cmdarg
     SetCommandLineArgument(port, 55556).shortcut("p").information("Network communication port to be used 0-65535 (default: 55556)");
 
