Index: trunk/EventBenchConsole/.classpath
===================================================================
--- trunk/EventBenchConsole/.classpath	(revision 246)
+++ trunk/EventBenchConsole/.classpath	(revision 247)
@@ -33,4 +33,5 @@
 	<classpathentry kind="lib" path="/Build/lib/vecmath-1.3.1.jar"/>
 	<classpathentry kind="lib" path="/Build/lib/wstx-asl-3.2.6.jar"/>
+	<classpathentry kind="lib" path="/Build/lib/jopt-simple-3.3.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/Runner.java
===================================================================
--- trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/Runner.java	(revision 246)
+++ trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/Runner.java	(revision 247)
@@ -1,4 +1,11 @@
 package de.ugoe.cs.eventbench;
 
+import java.io.IOException;
+import java.util.List;
+
+import joptsimple.OptionException;
+import joptsimple.OptionParser;
+import joptsimple.OptionSet;
+import joptsimple.OptionSpec;
 import de.ugoe.cs.eventbench.log4j.Log4JLogger;
 import de.ugoe.cs.eventbench.swt.MainWindow;
@@ -19,4 +26,8 @@
  */
 public class Runner {
+
+	public enum UITYPE {
+		text, swt
+	};
 
 	/**
@@ -39,20 +50,33 @@
 		CommandExecuter.getInstance().addCommandPackage(
 				"de.ugoe.cs.eventbench.efg.commands");
-		TextConsole textConsole = new TextConsole();
 		new Log4JLogger();
-		boolean swtGuiRunning = false;
-		if (args.length >= 1) {
-			if( args[0].equals("-swt") ) {
-				MainWindow mainWindow = new MainWindow();
-				mainWindow.open();
-				swtGuiRunning = true;
-			} else {
-				for (String command : args) {
-					CommandExecuter.getInstance().exec(command);
-				}
+
+		OptionParser parser = new OptionParser();
+		OptionSpec<UITYPE> ui = parser.accepts("ui", "Allowed values: text, swt").withRequiredArg()
+				.ofType(UITYPE.class).defaultsTo(UITYPE.text);
+		OptionSet options = parser.parse(args);
+
+		List<String> startupCommands = options.nonOptionArguments();
+		try {
+		switch (options.valueOf(ui)) {
+		case text:
+			TextConsole textConsole = new TextConsole();
+			for (String command : startupCommands) {
+				CommandExecuter.getInstance().exec(command);
 			}
+			textConsole.run(true);
+			break;
+		case swt:
+			MainWindow mainWindow = new MainWindow(startupCommands);
+			mainWindow.open();
+			break;
 		}
-		if( !swtGuiRunning ) {
-			textConsole.run(true);
+		} catch (OptionException e) {
+			System.err.println("Invalid Parameters: " + e.getMessage());
+			try {
+				parser.printHelpOn(System.out);
+			} catch (IOException e1) {
+				// ignore exception.
+			}
 		}
 	}
Index: trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/MainWindow.java
===================================================================
--- trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/MainWindow.java	(revision 246)
+++ trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/MainWindow.java	(revision 247)
@@ -1,3 +1,5 @@
 package de.ugoe.cs.eventbench.swt;
+
+import java.util.List;
 
 import org.eclipse.swt.widgets.Display;
@@ -25,4 +27,6 @@
  */
 public class MainWindow {
+	
+	private List<String> startupCommands;
 
 	protected Shell shlEventbenchConsole;
@@ -39,4 +43,8 @@
 	protected CommandHistoryDialog historyDialog;
 
+	public MainWindow(List<String> startupCommands) {
+		this.startupCommands = startupCommands;
+	}
+	
 	/**
 	 * <p>
@@ -53,4 +61,7 @@
 		shlEventbenchConsole.open();
 		shlEventbenchConsole.layout();
+		for(String command : startupCommands ) {
+			CommandExecuter.getInstance().exec(command);
+		}
 		while (!shlEventbenchConsole.isDisposed()) {
 			if (!display.readAndDispatch()) {
