Index: /trunk/src/defs/debug.h
===================================================================
--- /trunk/src/defs/debug.h	(revision 5182)
+++ /trunk/src/defs/debug.h	(revision 5183)
@@ -98,6 +98,7 @@
 #define PRINTFVDEBUG  PRINTF5
 
-//#ifdef
+#if DEBUG <= 3
 #define PRINTF(x)        PRINT(x)
+#endif
 #define PRINT_EXEC       ShellBuffer::addBufferLineStatic
 
Index: /trunk/src/lib/shell/shell.cc
===================================================================
--- /trunk/src/lib/shell/shell.cc	(revision 5182)
+++ /trunk/src/lib/shell/shell.cc	(revision 5183)
@@ -46,9 +46,9 @@
   this->setName("Shell");
 
+  // Element2D and generals
   this->setAbsCoor2D(3, -400);
   this->textSize = 15;
   this->lineSpacing = 5;
   this->bActive = false;
-
 
   // BUFFER
Index: /trunk/src/lib/shell/shell.h
===================================================================
--- /trunk/src/lib/shell/shell.h	(revision 5182)
+++ /trunk/src/lib/shell/shell.h	(revision 5183)
@@ -48,7 +48,7 @@
 
     // BUFFERS
-    void flush();
     void setBufferDisplaySize(unsigned int bufferDisplaySize);
     void printToDisplayBuffer(const char* text);
+    void flush();
 
     void clear();
@@ -56,5 +56,4 @@
     // EventListener
     virtual void process(const Event &event);
-
     // Element2D-functions
     virtual void draw() const;
@@ -63,12 +62,12 @@
 
   private:
-
     // helpers //
     Vector calculateLinePosition(unsigned int lineNumber);
-//     void testI (int i);
-//     void testS (const char* s);
-//     void testB (bool b);
-//     void testF (float f);
-//     void testSF (const char* s, float f);
+
+    //     void testI (int i);
+    //     void testS (const char* s);
+    //     void testB (bool b);
+    //     void testF (float f);
+    //     void testSF (const char* s, float f);
 
   private:
Index: /trunk/src/lib/shell/shell_buffer.cc
===================================================================
--- /trunk/src/lib/shell/shell_buffer.cc	(revision 5182)
+++ /trunk/src/lib/shell/shell_buffer.cc	(revision 5183)
@@ -91,5 +91,5 @@
 #endif
 
-  vprintf(line, arguments);
+    vprintf(line, arguments);
 #if DEBUG < 3
   else
Index: /trunk/src/lib/shell/shell_completion.cc
===================================================================
--- /trunk/src/lib/shell/shell_completion.cc	(revision 5182)
+++ /trunk/src/lib/shell/shell_completion.cc	(revision 5183)
@@ -20,4 +20,5 @@
 #include "shell_input.h"
 
+#include "substring.h"
 #include "base_object.h"
 #include "class_list.h"
@@ -62,9 +63,20 @@
 bool ShellCompletion::autoComplete(ShellInput* input)
 {
+  char* completionLine;
+
+  long classID;         //< the classID retrieved from the Class.
+  char* classBegin;     //< the beginn of the slass string
+  char* classEnd;       //< the end of the class string
+  char* objectBegin;    //< the begin of the object string
+  char* objectEnd;      //< the end of the object string
+  char* functionBegin;  //< the begin of the function string
+  char* functionEnd;    //< the end of the function string
+
   if (input != NULL)
     this->input = input;
-  //PRINTF(3)("AutoCompletion not implemented yet\n");
-
-  char* completionLine = new char[strlen(this->input->getText())+1];
+
+  SubString(input->getText(), true).debug();
+
+/*  completionLine = new char[strlen(this->input->getText())+1];
   strcpy(completionLine, this->input->getText());
 
@@ -92,5 +104,5 @@
     this->classComplete(commandBegin);
 
-  delete[] completionLine;
+  delete[] completionLine;*/
 }
 
Index: /trunk/src/lib/shell/shell_completion.h
===================================================================
--- /trunk/src/lib/shell/shell_completion.h	(revision 5182)
+++ /trunk/src/lib/shell/shell_completion.h	(revision 5183)
@@ -24,6 +24,9 @@
   bool autoComplete(ShellInput* input);
   bool classComplete(const char* classBegin);
+  long classMatch(const char* input, unsigned int* length);
   bool objectComplete(const char* objectBegin, long classID);
+  bool objectMatch(const char* objectBegin, long classID, unsigned int* length);
   bool functionComplete(const char* functionBegin);
+  bool functionMatch(const char* functionBegin, long classID, unsigned int* length);
 
   bool generalComplete(const tList<const char>* stringList, const char* begin, const char* displayAs = "%s", const char* addBack = NULL, const char* addFront = NULL);
Index: /trunk/src/lib/util/substring.cc
===================================================================
--- /trunk/src/lib/util/substring.cc	(revision 5182)
+++ /trunk/src/lib/util/substring.cc	(revision 5183)
@@ -52,5 +52,5 @@
   {
     const char* offset = string;
-    char* end = strchr( string, splitter);
+    const char* end = strchr( string, splitter);
     while( end != NULL)
     {
@@ -60,5 +60,5 @@
       assert( strings[i] != NULL);
       strncpy( strings[i], offset, l);
-      strings[i][l] = 0;
+      strings[i][l] = '\0';
       i++;
       end++;
@@ -74,6 +74,74 @@
   else
   {
-    this->strings[0] = new char[strlen(string)];
+    this->strings[0] = new char[strlen(string)+1];
     strcpy(this->strings[0], string);
+  }
+}
+
+
+/**
+ * Splits a String into a Substring removing all whiteSpaces
+ * @param string the String to Split
+ * @param whiteSpaces MUST BE __TRUE__
+ *
+ */
+SubString::SubString(const char* string, bool whiteSpaces)
+{
+  this->splittersCount = 0;
+  if (string == NULL || whiteSpaces == false)
+  {
+    this->strings = NULL;
+    return;
+  }
+
+  // chop the input to the beginning of something usefull
+  if (strlen(string) > 0)
+    string = string + strspn(string, " \t\n");
+
+  // count the Splitters
+  bool lastWasWhiteSpace = false;
+  for(unsigned int i = 0; i < strlen(string); i++)
+    if( string[i] == ' ' || string[i] == '\t' || string[i] == '\n' )
+      lastWasWhiteSpace = true;
+    else
+    {
+      if (lastWasWhiteSpace)
+        this->splittersCount ++;
+      lastWasWhiteSpace = false;
+    }
+
+  this->splittersCount += 1;
+
+  printf("splitterCount = %d\n", this->splittersCount);
+
+  this->strings = new char*[this->splittersCount];
+  assert (strings != NULL);
+
+  int l = 0;
+  unsigned int i = 0;
+  if( this->splittersCount > 1)
+  {
+    const char* offset = string;
+    const char* end = offset + strcspn(offset, " \t\n");
+    for (i = 0; i < this->splittersCount; i++)
+    {
+      assert( i < this->splittersCount);
+      l = end - offset;
+      this->strings[i] = new char[l + 1];
+      assert( strings[i] != NULL);
+      strncpy( strings[i], offset, l);
+      strings[i][l] = '\0';
+      end += strspn(end, " \t\n");
+      offset = end;
+      printf("'%s'\n", end);
+      end = offset + strcspn(offset, " \t\n");
+    }
+  }
+  else
+  {
+    unsigned int length = strcspn(string, " \t\n");
+    this->strings[0] = new char[length+1];
+    strncpy(this->strings[0], string, length);
+    this->strings[0][length] = '\0';
   }
 }
@@ -86,5 +154,5 @@
   if (this->strings)
   {
-    for( int i = 0; i < this->splittersCount; i++)
+    for(unsigned int i = 0; i < this->splittersCount; i++)
       delete[] this->strings[i];
     delete[] this->strings;
@@ -105,6 +173,4 @@
 }
 
-
-
 /**
  * Some nice debug information about this SubString
@@ -113,6 +179,7 @@
 {
   PRINT(0)("Substring-information::count=%d ::", this->splittersCount);
-  for (int i = 0; i < this->splittersCount; i++)
-    PRINT(0)("s%d:%s::", i, this->strings[i]);
+  if (this->strings != NULL)
+    for (unsigned int i = 0; i < this->splittersCount; i++)
+     PRINT(0)("s%d='%s'::", i, this->strings[i]);
   PRINT(0)("\n");
 }
Index: /trunk/src/lib/util/substring.h
===================================================================
--- /trunk/src/lib/util/substring.h	(revision 5182)
+++ /trunk/src/lib/util/substring.h	(revision 5183)
@@ -12,4 +12,5 @@
  public:
   SubString(const char* string, char splitter = ',');
+  SubString(const char* string, bool whiteSpaces);
   ~SubString();
 
Index: /trunk/src/orxonox.cc
===================================================================
--- /trunk/src/orxonox.cc	(revision 5182)
+++ /trunk/src/orxonox.cc	(revision 5183)
@@ -263,4 +263,5 @@
 int Orxonox::initMisc()
 {
+  ShellBuffer::getInstance();
   return 0;
 }
