Index: /trunk/java-utils/.classpath
===================================================================
--- /trunk/java-utils/.classpath	(revision 717)
+++ /trunk/java-utils/.classpath	(revision 718)
@@ -7,4 +7,5 @@
 		</attributes>
 	</classpathentry>
+	<classpathentry kind="src" path="src/main/resources"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
 		<attributes>
Index: /trunk/java-utils/pom.xml
===================================================================
--- /trunk/java-utils/pom.xml	(revision 717)
+++ /trunk/java-utils/pom.xml	(revision 718)
@@ -9,4 +9,16 @@
 		<url>https://quest.informatik.uni-goettingen.de/svn/quest/trunk/java-utils</url>
 	</scm>
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>commons-io</artifactId>
+			<version>1.3.2</version>
+		</dependency>
+		<dependency>
+        <groupId>commons-lang</groupId>
+        <artifactId>commons-lang</artifactId>
+        <version>2.1</version>
+      </dependency>
+	</dependencies>
 	<build>
 		<plugins>
Index: /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/CommandExecuter.java
===================================================================
--- /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/CommandExecuter.java	(revision 717)
+++ /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/CommandExecuter.java	(revision 718)
@@ -155,5 +155,5 @@
      *         otherwise
      */
-    private Command loadCMD(String className) {
+    public Command loadCMD(String className) {
         Command cmd = null;
         try {
@@ -171,4 +171,25 @@
         catch (ClassCastException e) {
             Console.traceln(Level.WARNING, className + "found, but does not implement Command");
+        }
+        return cmd;
+    }
+    
+    /**
+     * <p>
+     * Helper method that loads a class and tries to cast it to {@link Command}.
+     * </p>
+     * 
+     * @param className
+     *            qualified name of the class (including package name)
+     * @return if class is available and implement {@link Command} and instance of the class, null
+     *         otherwise
+     */
+    public Command getCMD(String commandName) {
+        Command cmd = null;
+        for (int i = 0; cmd == null && i < commandPackageList.size(); i++) {
+            cmd = loadCMD(commandPackageList.get(i) + "." + cmdPrefix + commandName);
+        }
+        if (cmd == null) { // check if command is available as default command
+            cmd = loadCMD(defaultPackage + "." + cmdPrefix + commandName);
         }
         return cmd;
Index: /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/defaultcommands/CMDman.java
===================================================================
--- /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/defaultcommands/CMDman.java	(revision 718)
+++ /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/defaultcommands/CMDman.java	(revision 718)
@@ -0,0 +1,74 @@
+
+package de.ugoe.cs.util.console.defaultcommands;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.InvalidParameterException;
+import java.util.List;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.WordUtils;
+
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.CommandExecuter;
+import de.ugoe.cs.util.console.Console;
+
+/**
+ * <p>
+ * Prints the manual of a command to the Console.
+ * </p>
+ * 
+ * @version $Revision: $ $Date: Aug 30, 2012$
+ * @author 2012, last modified by $Author: sherbold$
+ */
+public class CMDman implements Command {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+     */
+    @Override
+    public void run(List<Object> parameters) {
+        String command;
+        if (parameters.size() > 0) {
+            command = (String) parameters.get(0);
+        }
+        else {
+            throw new InvalidParameterException();
+        }
+
+        Command cmd = CommandExecuter.getInstance().getCMD(command);
+
+        if (cmd != null) {
+            InputStream manStream =
+                ClassLoader.getSystemResourceAsStream("manuals/" + command);
+            if (manStream != null) {
+                try {
+                    Console.println(WordUtils.wrap(IOUtils.toString(manStream, "UTF-8"), 100).replace("$USAGE$", "Usage: " + cmd.help()));
+                }
+                catch (IOException e) {
+                    Console.printerrln("Failure reading man page");
+                    Console.logException(e);
+                }
+            }
+            else {
+                Console.println("Usage: " + help());
+            }
+        }
+        else {
+            Console.println("Command " + command + " not found.");
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#help()
+     */
+    @Override
+    public String help() {
+        return "man <commandName>";
+    }
+
+}
Index: /trunk/java-utils/src/main/resources/manuals/exec
===================================================================
--- /trunk/java-utils/src/main/resources/manuals/exec	(revision 718)
+++ /trunk/java-utils/src/main/resources/manuals/exec	(revision 718)
@@ -0,0 +1,5 @@
+Executes a batch of commands. The batch is defined as a text file, where each line defines one command. Leading and trailing whitespaces are ignored.
+
+$USAGE$
+Example(s): 
+exec scripts/batchscript 
Index: /trunk/java-utils/src/main/resources/manuals/exit
===================================================================
--- /trunk/java-utils/src/main/resources/manuals/exit	(revision 718)
+++ /trunk/java-utils/src/main/resources/manuals/exit	(revision 718)
@@ -0,0 +1,3 @@
+Terminates the application.
+
+$USAGE$
Index: /trunk/java-utils/src/main/resources/manuals/listCommands
===================================================================
--- /trunk/java-utils/src/main/resources/manuals/listCommands	(revision 718)
+++ /trunk/java-utils/src/main/resources/manuals/listCommands	(revision 718)
@@ -0,0 +1,3 @@
+Writes a list of all commands, including their usage to the console.
+
+$USAGE$
Index: /trunk/java-utils/src/main/resources/manuals/man
===================================================================
--- /trunk/java-utils/src/main/resources/manuals/man	(revision 718)
+++ /trunk/java-utils/src/main/resources/manuals/man	(revision 718)
@@ -0,0 +1,5 @@
+Prints the manual of a command. 
+
+$USAGE$
+Example(s): 
+man exec
Index: /trunk/quest-ui-core/.classpath
===================================================================
--- /trunk/quest-ui-core/.classpath	(revision 717)
+++ /trunk/quest-ui-core/.classpath	(revision 718)
@@ -13,4 +13,5 @@
 		</attributes>
 	</classpathentry>
+	<classpathentry kind="src" path="src/main/resources"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
 		<attributes>
Index: /trunk/quest-ui-core/src/main/resources/manuals/trainMarkovModel
===================================================================
--- /trunk/quest-ui-core/src/main/resources/manuals/trainMarkovModel	(revision 718)
+++ /trunk/quest-ui-core/src/main/resources/manuals/trainMarkovModel	(revision 718)
@@ -0,0 +1,11 @@
+Trains a Markov model from a collection of sequences. 
+
+$USAGE$
+<modelName> is the name of the Markov model. This name can be used by other commands to refer the trained Markov model.
+<sequences> is the name of the sequences from which the model is trained in the storage.
+<markovOrder> is optional and defines the memory length of the trained Markov model. The default value is 1.
+
+Examples:
+trainMarkovModel mm sequences
+trainMarkovModel mm sequences 3
+ 
