Index: /trunk/autoquest-runner/.classpath
===================================================================
--- /trunk/autoquest-runner/.classpath	(revision 911)
+++ /trunk/autoquest-runner/.classpath	(revision 911)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/classes" path="src/main/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>
Index: /trunk/autoquest-runner/.project
===================================================================
--- /trunk/autoquest-runner/.project	(revision 911)
+++ /trunk/autoquest-runner/.project	(revision 911)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>quest-runner</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.m2e.core.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.m2e.core.maven2Nature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
Index: /trunk/autoquest-runner/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- /trunk/autoquest-runner/.settings/org.eclipse.jdt.core.prefs	(revision 911)
+++ /trunk/autoquest-runner/.settings/org.eclipse.jdt.core.prefs	(revision 911)
@@ -0,0 +1,5 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.6
Index: /trunk/autoquest-runner/.settings/org.eclipse.m2e.core.prefs
===================================================================
--- /trunk/autoquest-runner/.settings/org.eclipse.m2e.core.prefs	(revision 911)
+++ /trunk/autoquest-runner/.settings/org.eclipse.m2e.core.prefs	(revision 911)
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
Index: /trunk/autoquest-runner/bin/run.sh
===================================================================
--- /trunk/autoquest-runner/bin/run.sh	(revision 911)
+++ /trunk/autoquest-runner/bin/run.sh	(revision 911)
@@ -0,0 +1,108 @@
+#!/bin/sh
+
+HOME_DIR=`dirname $0`
+
+# Given the "java" executable as an argument, find JAVA_HOME
+find_java() {
+  # First check if it is a JDK in the /usr/lib/jvm directory, or a symlink there.
+  # The test is somewhat complicated due to the different ways the Java implementations
+  # are set up with the alternatives system
+  # e.g.
+  #  /usr/bin/java -> /etc/alternatives/java -> /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
+  # or
+  #  /usr/bin/java -> /etc/alternatives/java -> /usr/lib/jvm/java-gcj/bin/java -> /usr/bin/gij-4.2
+
+  JAVA_HOME=$1
+  while true ; do
+    case $JAVA_HOME in
+      /usr/lib/jvm/*)
+        # Found it! Return the correct paremt directory.
+
+        JAVA_HOME=`echo $JAVA_HOME | sed 's:\(/usr/lib/jvm/[^/]*\).*:\1:'`
+	return
+	;;
+      *) ;;
+    esac
+
+    if [ -h $JAVA_HOME ] ; then
+      JAVA_HOME=`readlink $JAVA_HOME`
+    else
+      break
+    fi
+  done
+        
+  # Not found in the Debian alternatives system, so presumably
+  # it is a user-installed JDK/JRE. Might as well be helpful
+  # and try to find JAVA_HOME.
+
+  # First try for a JDK:
+  JAVA_HOME=`readlink -e $1`
+  while [ `dirname $JAVA_HOME` != /  ]; do
+    if [ -e $JAVA_HOME/lib/tools.jar ]; then
+      return
+    fi
+
+    JAVA_HOME=`dirname $JAVA_HOME`
+  done
+
+  # If we get here we did not find a JDK. Search again for a JRE:
+  JAVA_HOME=`readlink -e $1`
+  while [ `dirname $JAVA_HOME` != /  ]; do
+    if [ -e $JAVA_HOME/bin/java ]; then
+      return
+    fi
+
+    JAVA_HOME=`dirname $JAVA_HOME`
+  done
+
+  # Nothing found; leave blank
+  JAVA_HOME=
+}
+
+if [ -z "$JAVA_HOME" ] ; then
+  if [ -r /etc/gentoo-release ] ; then
+    JAVA_HOME=`java-config --jre-home`
+  else
+    # Debian patch - search for preferred JRE
+    if [ -n "$JAVACMD" ] ; then
+      find_java "$JAVACMD"
+    else
+      find_java `which java`
+    fi
+  fi
+fi
+
+if [ -z "$JAVACMD" ] ; then
+  if [ -n "$JAVA_HOME"  ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+      # IBM's JDK on AIX uses strange locations for the executables
+      JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+      JAVACMD="$JAVA_HOME/bin/java"
+    fi
+  else
+    JAVACMD="`which java`"
+  fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+  echo "Error: JAVA_HOME is not defined correctly."
+  echo "  We cannot execute $JAVACMD"
+  exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+  echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+cd ${HOME_DIR}
+
+JAR_FILE=`find . -type f -name 'quest-runner-*.jar'`
+
+if [ ! -f "$JAR_FILE" ] ; then
+  echo "Error: Could not find executable jar file in distribution."
+  echo "  Execution aborted."
+  exit 1
+fi
+
+exec "$JAVACMD" -jar "${JAR_FILE}" $*
Index: /trunk/autoquest-runner/data/log4j.properties
===================================================================
--- /trunk/autoquest-runner/data/log4j.properties	(revision 911)
+++ /trunk/autoquest-runner/data/log4j.properties	(revision 911)
@@ -0,0 +1,10 @@
+log4j.rootLogger=TRACE, file
+
+log4j.appender.file=org.apache.log4j.RollingFileAppender
+log4j.appender.file.File=log/log4j.log
+
+log4j.appender.file.MaxFileSize=100KB
+log4j.appender.file.MaxBackupIndex=1
+
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
Index: /trunk/autoquest-runner/pom.xml
===================================================================
--- /trunk/autoquest-runner/pom.xml	(revision 911)
+++ /trunk/autoquest-runner/pom.xml	(revision 911)
@@ -0,0 +1,209 @@
+<project
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+>
+  <parent>
+    <groupId>de.ugoe.cs.quest</groupId>
+    <artifactId>quest</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>quest-runner</artifactId>
+  <name>quest-runner</name>
+  <scm>
+    <url>${quest-scm-trunk-dir}/quest-runner</url>
+  </scm>
+  <dependencies>
+    <dependency>
+      <groupId>de.ugoe.cs</groupId>
+      <artifactId>java-utils</artifactId>
+      <version>0.0.1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>de.ugoe.cs.quest</groupId>
+      <artifactId>quest-plugin-core</artifactId>
+      <version>${project.parent.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>de.ugoe.cs.quest</groupId>
+      <artifactId>quest-ui-core</artifactId>
+      <version>${project.parent.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>de.ugoe.cs.quest</groupId>
+      <artifactId>quest-ui-swt</artifactId>
+      <version>${project.parent.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>net.sf.jopt-simple</groupId>
+      <artifactId>jopt-simple</artifactId>
+      <version>4.3</version>
+    </dependency>
+    <dependency>
+      <groupId>de.ugoe.cs.quest</groupId>
+      <artifactId>quest-plugin-guitar</artifactId>
+      <version>${project.parent.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>de.ugoe.cs.quest</groupId>
+      <artifactId>quest-plugin-jfc</artifactId>
+      <version>${project.parent.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>de.ugoe.cs.quest</groupId>
+      <artifactId>quest-plugin-mfc</artifactId>
+      <version>${project.parent.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>de.ugoe.cs.quest</groupId>
+      <artifactId>quest-plugin-php</artifactId>
+      <version>${project.parent.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <version>1.2.17</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.eclipse.m2e</groupId>
+          <artifactId>lifecycle-mapping</artifactId>
+          <version>1.0.0</version>
+          <configuration>
+            <lifecycleMappingMetadata>
+              <pluginExecutions>
+                <pluginExecution>
+                  <pluginExecutionFilter>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-dependency-plugin</artifactId>
+                    <versionRange>[1.0.0,)</versionRange>
+                    <goals>
+                      <goal>get</goal>
+                    </goals>
+                  </pluginExecutionFilter>
+                  <action>
+                    <ignore />
+                  </action>
+                </pluginExecution>
+                <pluginExecution>
+                  <pluginExecutionFilter>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-dependency-plugin</artifactId>
+                    <versionRange>[1.0.0,)</versionRange>
+                    <goals>
+                      <goal>unpack</goal>
+                    </goals>
+                  </pluginExecutionFilter>
+                  <action>
+                    <ignore />
+                  </action>
+                </pluginExecution>
+              </pluginExecutions>
+            </lifecycleMappingMetadata>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+          <archive>
+            <manifest>
+              <addClasspath>true</addClasspath>
+              <classpathPrefix>lib/</classpathPrefix>
+              <mainClass>de.ugoe.cs.quest.ui.Runner</mainClass>
+            </manifest>
+          </archive>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>2.4</version>
+        <executions>
+          <execution>
+            <id>get-jfc-plugin-config</id>
+            <phase>process-classes</phase>
+            <goals>
+              <goal>unpack</goal>
+            </goals>
+            <configuration>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>de.ugoe.cs.quest</groupId>
+                  <artifactId>quest-plugin-jfc</artifactId>
+                  <version>${project.parent.version}</version>
+                  <classifier>config</classifier>
+                  <type>zip</type>
+                  <outputDirectory>${project.build.directory}/data</outputDirectory>
+                </artifactItem>
+              </artifactItems>
+            </configuration>
+          </execution>
+          <execution>
+            <id>get-mfc-plugin-config</id>
+            <phase>process-classes</phase>
+            <goals>
+              <goal>unpack</goal>
+            </goals>
+            <configuration>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>de.ugoe.cs.quest</groupId>
+                  <artifactId>quest-plugin-mfc</artifactId>
+                  <version>${project.parent.version}</version>
+                  <classifier>config</classifier>
+                  <type>zip</type>
+                  <outputDirectory>${project.build.directory}/data</outputDirectory>
+                </artifactItem>
+              </artifactItems>
+            </configuration>
+          </execution>
+          <execution>
+            <id>get-php-plugin-config</id>
+            <phase>process-classes</phase>
+            <goals>
+              <goal>unpack</goal>
+            </goals>
+            <configuration>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>de.ugoe.cs.quest</groupId>
+                  <artifactId>quest-plugin-php</artifactId>
+                  <version>${project.parent.version}</version>
+                  <classifier>config</classifier>
+                  <type>zip</type>
+                  <outputDirectory>${project.build.directory}/data</outputDirectory>
+                </artifactItem>
+              </artifactItems>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <version>2.2-beta-2</version>
+        <configuration>
+          <descriptors>
+            <descriptor>src/main/assembly/bin.xml</descriptor>
+          </descriptors>
+        </configuration>
+        <executions>
+          <execution>
+            <id>make-assembly</id>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
Index: /trunk/autoquest-runner/src/main/assembly/bin.xml
===================================================================
--- /trunk/autoquest-runner/src/main/assembly/bin.xml	(revision 911)
+++ /trunk/autoquest-runner/src/main/assembly/bin.xml	(revision 911)
@@ -0,0 +1,51 @@
+<assembly
+    xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+  <id>bin</id>
+  <formats>
+    <format>tar.gz</format>
+    <format>dir</format>
+    <!-- format>tar.bz2</format>
+    <format>zip</format-->
+  </formats>
+  <dependencySets>
+    <dependencySet>
+      <includes></includes>
+      <excludes>
+        <exclude>de.ugoe.cs.quest:quest-runner</exclude>
+      </excludes>
+      <outputDirectory>lib</outputDirectory>
+    </dependencySet>
+    <dependencySet>
+      <includes>
+          <include>de.ugoe.cs.quest:quest-runner</include>
+      </includes>
+      <outputDirectory></outputDirectory>
+    </dependencySet>
+  </dependencySets>
+  <fileSets>
+    <fileSet>
+      <directory>bin</directory>
+      <outputDirectory></outputDirectory>
+      <fileMode>775</fileMode>
+      <includes>
+        <include>*</include>
+      </includes>
+    </fileSet>
+    <!-- <fileSet>
+      <directory>target/plugins</directory>
+      <outputDirectory>plugins</outputDirectory>
+      <includes>
+        <include>*.jar</include>
+      </includes>
+    </fileSet>-->
+    <fileSet>
+      <directory>target/data</directory>
+      <outputDirectory>data</outputDirectory>
+      <excludes>
+        <exclude>META-INF/**</exclude>
+      </excludes>
+    </fileSet>
+  </fileSets>
+</assembly>
Index: /trunk/autoquest-runner/src/main/java/de/ugoe/cs/quest/log4j/Log4JLogger.java
===================================================================
--- /trunk/autoquest-runner/src/main/java/de/ugoe/cs/quest/log4j/Log4JLogger.java	(revision 911)
+++ /trunk/autoquest-runner/src/main/java/de/ugoe/cs/quest/log4j/Log4JLogger.java	(revision 911)
@@ -0,0 +1,128 @@
+
+package de.ugoe.cs.quest.log4j;
+
+import java.util.logging.Level;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.PropertyConfigurator;
+
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.listener.ICommandListener;
+import de.ugoe.cs.util.console.listener.IErrorListener;
+import de.ugoe.cs.util.console.listener.IExceptionListener;
+import de.ugoe.cs.util.console.listener.ITraceListener;
+
+/**
+ * <p>
+ * Implements logging based on the log4j API.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class Log4JLogger implements IErrorListener, ITraceListener, IExceptionListener,
+    ICommandListener
+{
+
+    /**
+     * <p>
+     * Reference to the logger.
+     * </p>
+     */
+    Logger logger;
+
+    /**
+     * <p>
+     * This is the trace level according to the Java logger API. We use this instead of the log4j
+     * levels themselves for the logging.
+     * </p>
+     */
+    Level traceLevel;
+
+    /**
+     * <p>
+     * Constructor. Creates a new Log4JLogger and registers the implemented listener with the
+     * {@link Console}.
+     * </p>
+     * @param traceLevel tracing level
+     */
+    public Log4JLogger(Level traceLevel) {
+        PropertyConfigurator.configure("data/log4j.properties");
+        logger = Logger.getLogger("de.ugoe.cs.quest");
+        logger.setLevel(convertToLog4JLevel(traceLevel));
+        this.traceLevel = traceLevel;
+        Console.getInstance().registerErrorListener(this);
+        Console.getInstance().registerTraceListener(this);
+        Console.getInstance().registerExceptionListener(this);
+        Console.getInstance().registerCommandListener(this);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.listener.ICommandListener#commandNotification (java.lang.String)
+     */
+    @Override
+    public void commandNotification(String command) {
+        logger.info("Command executed: " + command);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.listener.IExceptionListener#printStacktrace(java
+     * .lang.Exception)
+     */
+    @Override
+    public void logException(Exception e) {
+        logger.error("", e);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.listener.ITraceListener#traceMsg(java.lang.String )
+     */
+    @Override
+    public void traceMsg(String traceMessage, Level level) {
+        if( level.intValue()>=traceLevel.intValue()) {
+            logger.log(convertToLog4JLevel(level), traceMessage);
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.listener.IErrorListener#errorMsg(java.lang.String )
+     */
+    @Override
+    public void errorMsg(String errMessage) {
+        logger.error(errMessage);
+    }
+
+    /**
+     * <p>
+     * Converts the log level described by {@link Level} into a {@link org.apache.log4j.Level}.
+     * </p>
+     * 
+     * @param level
+     *            java.util.logger.Level severity
+     * @return org.apache.log4j.Level severity
+     */
+    private org.apache.log4j.Level convertToLog4JLevel(Level level) {
+        if (level == Level.OFF) {
+            return org.apache.log4j.Level.OFF;
+        }
+        if (level == Level.SEVERE) {
+            return org.apache.log4j.Level.FATAL;
+        }
+        if (level == Level.WARNING) {
+            return org.apache.log4j.Level.WARN;
+        }
+        if (level == Level.INFO || level == Level.CONFIG) {
+            return org.apache.log4j.Level.INFO;
+        }
+        // remaining levels: FINE, FINER, FINEST, ALL
+        return org.apache.log4j.Level.ALL;
+    }
+}
Index: /trunk/autoquest-runner/src/main/java/de/ugoe/cs/quest/ui/Runner.java
===================================================================
--- /trunk/autoquest-runner/src/main/java/de/ugoe/cs/quest/ui/Runner.java	(revision 911)
+++ /trunk/autoquest-runner/src/main/java/de/ugoe/cs/quest/ui/Runner.java	(revision 911)
@@ -0,0 +1,141 @@
+
+package de.ugoe.cs.quest.ui;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import java.util.logging.Level;
+
+import joptsimple.OptionException;
+import joptsimple.OptionParser;
+import joptsimple.OptionSet;
+import joptsimple.OptionSpec;
+import de.ugoe.cs.quest.log4j.Log4JLogger;
+import de.ugoe.cs.quest.plugin.PluginLoader;
+import de.ugoe.cs.quest.plugin.QuestPlugin;
+import de.ugoe.cs.quest.ui.swt.MainWindow;
+import de.ugoe.cs.util.console.CommandExecuter;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.TextConsole;
+
+/**
+ * <p>
+ * Start-up class of the application.
+ * </p>
+ * <p>
+ * It sets up and starts the {@link Console}.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class Runner {
+
+    public enum UITYPE {
+        text, swt
+    };
+    
+    public enum LEVELENUM {
+        OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL;
+        
+        public Level getLevel() {
+            switch (this)
+            {
+                case OFF:
+                    return Level.OFF;
+                case SEVERE:
+                    return Level.SEVERE;
+                case ALL:
+                    return Level.ALL;
+                case CONFIG:
+                    return Level.CONFIG;
+                case FINE:
+                    return Level.FINE;
+                case FINER:
+                    return Level.FINER;
+                case FINEST:
+                    return Level.FINEST;
+                case INFO:
+                    return Level.INFO;
+                case WARNING:
+                    return Level.WARNING;
+                default:
+                    throw new AssertionError("reached source code that should be unreachable");
+            }
+        }
+    }
+
+    /**
+     * <p>
+     * Main method of the application.
+     * </p>
+     * 
+     * @param args
+     *            if parameters are defined, they are interpreted as commands for the
+     *            {@link Console} and executed before the user can use the console; can be used to
+     *            perform batch operations
+     */
+    public static void main(String[] args) {
+        
+        CommandExecuter.getInstance().addCommandPackage("de.ugoe.cs.quest.commands.misc");
+        CommandExecuter.getInstance().addCommandPackage("de.ugoe.cs.quest.commands.sequences");
+        CommandExecuter.getInstance().addCommandPackage("de.ugoe.cs.quest.commands.usability");
+        CommandExecuter.getInstance().addCommandPackage("de.ugoe.cs.quest.commands.usage");
+        CommandExecuter.getInstance().addCommandPackage("de.ugoe.cs.quest.ui.swt.commands");
+
+        PluginLoader pluginLoader = new PluginLoader(new File("lib"));
+        pluginLoader.load();
+
+        for (QuestPlugin plugin : pluginLoader.getPlugins()) {
+            for (String commandPackage : plugin.getCommandPackages()) {
+                CommandExecuter.getInstance().addCommandPackage(commandPackage);
+            }
+        }
+
+        OptionParser parser = new OptionParser();
+        OptionSpec<LEVELENUM> log4j =
+            parser.accepts("log4j", "Allowed values: OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL").withRequiredArg()
+                .ofType(LEVELENUM.class).defaultsTo(LEVELENUM.INFO);
+        OptionSpec<UITYPE> ui =
+            parser.accepts("ui", "Allowed values: text, swt").withRequiredArg()
+                .ofType(UITYPE.class).defaultsTo(UITYPE.text);
+        OptionSpec<LEVELENUM> trace =
+            parser.accepts("trace", "Allowed values: OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL").withRequiredArg()
+                .ofType(LEVELENUM.class).defaultsTo(LEVELENUM.WARNING);
+        OptionSet options = parser.parse(args);
+
+        List<String> startupCommands = options.nonOptionArguments();
+        try {
+            if(options.valueOf(log4j)!=LEVELENUM.OFF) {
+                new Log4JLogger(options.valueOf(log4j).getLevel());
+            }
+
+            switch (options.valueOf(ui))
+            {
+                case text:
+                    TextConsole textConsole = new TextConsole(options.valueOf(trace).getLevel());
+                    for (String command : startupCommands) {
+                        CommandExecuter.getInstance().exec(command);
+                    }
+                    textConsole.run();
+                    break;
+                case swt:
+                    MainWindow mainWindow = new MainWindow(startupCommands, options.valueOf(trace).getLevel());
+                    mainWindow.open();
+                    break;
+                default:
+                    throw new AssertionError("reached source code that should be unreachable");
+            }
+        }
+        catch (OptionException e) {
+            System.err.println("Invalid Parameters: " + e.getMessage());
+            try {
+                parser.printHelpOn(System.out);
+            }
+            catch (IOException e1) {
+                // ignore exception.
+            }
+        }
+    }
+
+}
