Index: code/branches/core4/src/core/CommandLine.cc
===================================================================
--- code/branches/core4/src/core/CommandLine.cc	(revision 3245)
+++ code/branches/core4/src/core/CommandLine.cc	(revision 3246)
@@ -40,5 +40,5 @@
 namespace orxonox
 {
-    SetCommandLineArgument(optionsFile, "start.ini").shortcut("o");
+    SetCommandLineOnlyArgument(optionsFile, "start.ini").shortcut("o");
 
     /**
@@ -49,6 +49,8 @@
         so that you can have simple command line switches.
     */
-    void CommandLineArgument::parse(const std::string& value)
-    {
+    void CommandLineArgument::parse(const std::string& value, bool bParsingFile)
+    {
+        if (bParsingFile && this->bCommandLineOnly_)
+            ThrowException(Argument, "Command line argument '" + getName() + "' is not allowed in files.");
         if (value_.getType() == MT_bool)
         {
@@ -66,7 +68,5 @@
             }
             else
-            {
                 ThrowException(Argument, "Could not read command line argument '" + getName() + "'.");
-            }
         }
         else
@@ -126,102 +126,111 @@
         Vector of space separated strings.
     */
-    void CommandLine::_parse(const std::vector<std::string>& arguments)
-    {
-        // 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() != "")
-                    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] == '-')
+    void CommandLine::_parse(const std::vector<std::string>& arguments, bool bParsingFile)
+    {
+        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)
                 {
-                    // start with "-"
-                    if (arguments[i].size() == 1)
+                    OrxAssert(cmdLineArgsShortcut_.find(it->second->getShortcut()) == cmdLineArgsShortcut_.end(),
+                        "Cannot have two command line shortcut with the same name.");
+                    if (it->second->getShortcut() != "")
+                        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] == '-')
                     {
-                        // 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] + " ";
+                        // 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 != "")
+                            {
+                                checkFullArgument(name, value, bParsingFile);
+                                name = "";
+                                assert(shortcut == "");
+                            }
+                            else if (shortcut != "")
+                            {
+                                checkShortcut(shortcut, value, bParsingFile);
+                                shortcut = "";
+                                assert(name == "");
+                            }
+
+                            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 = "";
+                        }
                     }
                     else
                     {
-                        // can be shortcut or full name argument
-
-                        // save old data first
-                        value = removeTrailingWhitespaces(value);
-                        if (name != "")
+                        // value string
+
+                        if (name == "" && shortcut == "")
                         {
-                            checkFullArgument(name, value);
-                            name = "";
-                            assert(shortcut == "");
+                            ThrowException(Argument, "Expected \"-\" or \"-\" in command line arguments.\n");
                         }
-                        else if (shortcut != "")
-                        {
-                            checkShortcut(shortcut, value);
-                            shortcut = "";
-                            assert(name == "");
-                        }
-
-                        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 = "";
+
+                        // Concatenate strings as long as there's no new argument by "-" or "--"
+                        value += arguments[i] + ' ';
                     }
                 }
-                else
-                {
-                    // value string
-
-                    if (name == "" && shortcut == "")
-                    {
-                        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 != "")
-        {
-            checkFullArgument(name, value);
-            assert(shortcut == "");
-        }
-        else if (shortcut != "")
-        {
-            checkShortcut(shortcut, value);
-            assert(name == "");
+            }
+
+            // parse last argument
+            value = removeTrailingWhitespaces(value);
+            if (name != "")
+            {
+                checkFullArgument(name, value, bParsingFile);
+                assert(shortcut == "");
+            }
+            else if (shortcut != "")
+            {
+                checkShortcut(shortcut, value, bParsingFile);
+                assert(name == "");
+            }
+        }
+        catch (const ArgumentException& ex)
+        {
+            COUT(0) << "Could not parse command line (including additional files): " << ex.what() << std::endl;
+            COUT(0) << "Usage:" << std::endl << "orxonox " << CommandLine::getUsageInformation() << std::endl;
+            throw GeneralException("");
         }
     }
@@ -235,5 +244,5 @@
         String containing the value
     */
-    void CommandLine::checkFullArgument(const std::string& name, const std::string& value)
+    void CommandLine::checkFullArgument(const std::string& name, const std::string& value, bool bParsingFile)
     {
         std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgs_.find(name);
@@ -241,5 +250,5 @@
             ThrowException(Argument, "Command line argument '" + name + "' does not exist.");
 
-        it->second->parse(value);
+        it->second->parse(value, bParsingFile);
     }
 
@@ -252,5 +261,5 @@
         String containing the value
     */
-    void CommandLine::checkShortcut(const std::string& shortcut, const std::string& value)
+    void CommandLine::checkShortcut(const std::string& shortcut, const std::string& value, bool bParsingFile)
     {
         std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgsShortcut_.find(shortcut);
@@ -258,5 +267,5 @@
             ThrowException(Argument, "Command line shortcut '" + shortcut + "' does not exist.");
 
-        it->second->parse(value);
+        it->second->parse(value, bParsingFile);
     }
 
@@ -295,14 +304,20 @@
     /**
     @brief
-        Parses both command line and start.ini for CommandLineArguments.
-    */
-    void CommandLine::_parseAll(int argc, char** argv)
-    {
-        // parse command line first
+        Parses only the command line for CommandLineArguments.
+    */
+    void CommandLine::_parseCommandLine(int argc, char** argv)
+    {
         std::vector<std::string> args;
         for (int i = 1; i < argc; ++i)
             args.push_back(argv[i]);
-        this->_parse(args);
-
+        this->_parse(args, false);
+    }
+
+    /**
+    @brief
+        Parses start.ini (or the file specified with --optionsFile) for CommandLineArguments.
+    */
+    void CommandLine::_parseFile()
+    {
         std::string filename = CommandLine::getValue("optionsFile").getString();
         boost::filesystem::path filepath(Core::getConfigPath() / filename);
@@ -312,5 +327,5 @@
         std::ifstream file;
         file.open(filepath.string().c_str());
-        args.clear();
+        std::vector<std::string> args;
         if (file)
         {
@@ -332,13 +347,5 @@
         }
 
-        try
-        {
-            _parse(args);
-        }
-        catch (orxonox::ArgumentException& ex)
-        {
-            COUT(1) << "An Exception occured while parsing " << filename << std::endl;
-            throw(ex);
-        }
+        _parse(args, true);
     }
 }
Index: code/branches/core4/src/core/CommandLine.h
===================================================================
--- code/branches/core4/src/core/CommandLine.h	(revision 3245)
+++ code/branches/core4/src/core/CommandLine.h	(revision 3246)
@@ -38,8 +38,14 @@
 #define SetCommandLineArgument(name, defaultValue) \
     orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
-    = orxonox::CommandLine::addArgument(#name, defaultValue)
+    = orxonox::CommandLine::addArgument(#name, defaultValue, false)
+#define SetCommandLineOnlyArgument(name, defaultValue) \
+    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
+    = orxonox::CommandLine::addArgument(#name, defaultValue, true)
 #define SetCommandLineSwitch(name) \
     orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
-    = orxonox::CommandLine::addArgument(#name, false)
+    = orxonox::CommandLine::addArgument(#name, false, false)
+#define SetCommandLineOnlySwitch(name) \
+    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
+    = orxonox::CommandLine::addArgument(#name, false, true)
 
 
@@ -93,9 +99,10 @@
     private:
         //! Constructor initialises both value_ and defaultValue_ with defaultValue.
-        CommandLineArgument(const std::string& name, const MultiType& defaultValue)
+        CommandLineArgument(const std::string& name, const MultiType& defaultValue, bool bCommandLineOnly)
             : bHasDefaultValue_(true)
             , name_(name)
             , value_(defaultValue)
             , defaultValue_(defaultValue)
+            , bCommandLineOnly_(bCommandLineOnly)
         { }
 
@@ -105,5 +112,5 @@
 
         //! Parses the value string of a command line argument.
-        void parse(const std::string& value);
+        void parse(const std::string& value, bool bParsingFile);
 
         //! Tells whether the value has been changed by the command line.
@@ -115,6 +122,7 @@
         std::string usageInformation_; //!< Tells about the usage of this parameter
 
-        MultiType value_;            //!< The actual value
-        MultiType defaultValue_;     //!< Default value. Should not be changed.
+        MultiType   value_;            //!< The actual value
+        MultiType   defaultValue_;     //!< Default value. Should not be changed.
+        bool        bCommandLineOnly_; //!< Whether you cannot specify the value in a text file
     };
 
@@ -134,5 +142,6 @@
 
         //! Parse redirection to internal member method.
-        static void parseAll(int argc, char** argv) { _getInstance()._parseAll(argc, argv); }
+        static void parseCommandLine(int argc, char** argv) { _getInstance()._parseCommandLine(argc, argv); }
+        static void parseFile() { _getInstance()._parseFile(); }
 
         static std::string getUsageInformation();
@@ -146,5 +155,5 @@
         { return getArgument(name)->getValue(); }
         template <class T>
-        static CommandLineArgument& addArgument(const std::string& name, T defaultValue);
+        static CommandLineArgument& addArgument(const std::string& name, T defaultValue, bool bCommandLineOnly);
 
         static bool existsArgument(const std::string& name)
@@ -165,8 +174,9 @@
         static CommandLine& _getInstance();
 
-        void _parseAll(int argc, char** argv);
-        void _parse(const std::vector<std::string>& arguments);
-        void checkFullArgument(const std::string& name, const std::string& value);
-        void checkShortcut(const std::string& shortcut, const std::string& value);
+        void _parseCommandLine(int argc, char** argv);
+        void _parseFile();
+        void _parse(const std::vector<std::string>& arguments, bool bParsingFile);
+        void checkFullArgument(const std::string& name, const std::string& value, bool bParsingFile);
+        void checkShortcut(const std::string& shortcut, const std::string& value, bool bParsingFile);
 
         /**
@@ -199,10 +209,10 @@
     */
     template <class T>
-    CommandLineArgument& CommandLine::addArgument(const std::string& name, T defaultValue)
+    CommandLineArgument& CommandLine::addArgument(const std::string& name, T defaultValue, bool bCommandLineOnly)
     {
         OrxAssert(!_getInstance().existsArgument(name),
             "Cannot add a command line argument with name '" + name + "' twice.");
 
-        return *(_getInstance().cmdLineArgs_[name] = new CommandLineArgument(name, defaultValue));
+        return *(_getInstance().cmdLineArgs_[name] = new CommandLineArgument(name, defaultValue, bCommandLineOnly));
     }
 }
Index: code/branches/core4/src/core/Core.cc
===================================================================
--- code/branches/core4/src/core/Core.cc	(revision 3245)
+++ code/branches/core4/src/core/Core.cc	(revision 3246)
@@ -88,5 +88,5 @@
 
     SetCommandLineArgument(mediaPath, "").information("PATH");
-    SetCommandLineArgument(writingPathSuffix, "").information("DIR");
+    SetCommandLineOnlyArgument(writingPathSuffix, "").information("DIR");
     SetCommandLineArgument(settingsFile, "orxonox.ini");
     SetCommandLineArgument(limitToCPU, 0).information("0: off | #cpu");
@@ -103,13 +103,5 @@
     {
         // Parse command line arguments fist
-        try
-        {
-            CommandLine::parseAll(argc, argv);
-        }
-        catch (ArgumentException& ex)
-        {
-            COUT(1) << ex.what() << std::endl;
-            COUT(0) << "Usage:" << std::endl << "orxonox " << CommandLine::getUsageInformation() << std::endl;
-        }
+        CommandLine::parseCommandLine(argc, argv);
 
         // limit the main thread to the first core so that QueryPerformanceCounter doesn't jump
@@ -137,4 +129,6 @@
         // Set the correct log path. Before this call, /tmp (Unix) or %TEMP% was used
         OutputHandler::getOutStream().setLogPath(Core::getLogPathString());
+
+        CommandLine::parseFile();
 
         // Manage ini files and set the default settings file (usually orxonox.ini)
