Index: /trunk/src/lib/shell/shell_command.cc
===================================================================
--- /trunk/src/lib/shell/shell_command.cc	(revision 7412)
+++ /trunk/src/lib/shell/shell_command.cc	(revision 7413)
@@ -102,9 +102,26 @@
   }
 
-
   /**
    * @brief gets a command if it has already been registered.
    * @param commandName the name of the Command
-   * @param className the name of the Class the command should apply to.
+   * @param cmdClass the CommandClass of the Class the command is in.
+   * @returns The Registered Command, or NULL if it does not exist.
+   */
+  const ShellCommand* const ShellCommand::getCommand(const std::string& commandName, const ShellCommandClass* cmdClass)
+  {
+    assert(cmdClass != NULL);
+
+    std::vector<ShellCommand*>::const_iterator elem;
+    for (elem = cmdClass->commandList.begin(); elem != cmdClass->commandList.end(); elem++)
+      if (commandName == (*elem)->getName())
+        return (*elem);
+    return NULL;
+  }
+
+
+  /**
+   * @brief gets a command if it has already been registered.
+   * @param commandName the name of the Command
+   * @param className the name of the Class the command is in.
    * @returns The Registered Command, or NULL if it does not exist.
    */
@@ -113,15 +130,44 @@
     const ShellCommandClass* checkClass = ShellCommandClass::getCommandClass(className);
     if (likely(checkClass != NULL))
-    {
-      std::vector<ShellCommand*>::const_iterator elem;
-      for (elem = checkClass->commandList.begin(); elem != checkClass->commandList.end(); elem++)
-        if (commandName == (*elem)->getName())
-        {
-          PRINTF(2)("Command '%s::%s' already registered\n", className.c_str(), commandName.c_str());
-          return (*elem);
-        }
-    }
+      return ShellCommand::getCommand(commandName, checkClass);
     return NULL;
   }
+
+  /**
+   * @brief takes out an InputLine, searching for a Command.
+   * @param inputLine: the Input to analyse.
+   * @returns: The ShellCommand if found.
+   */
+  const ShellCommand* const ShellCommand::getCommandFromInput(const std::string& inputLine)
+  {
+    SubString strings(inputLine, SubString::WhiteSpaces);
+    // no input, no Command.
+    if (strings.size() == 0)
+      return NULL;
+
+    // CHECK FOR ALIAS
+    std::vector<ShellCommandAlias*>::const_iterator alias;
+    for (alias = ShellCommandAlias::getAliases().begin(); alias != ShellCommandAlias::getAliases().end(); alias++ )
+    {
+      if (strings[0] == (*alias)->getName())
+      {
+        assert ((*alias)->getCommand() != NULL && (*alias)->getCommand()->shellClass != NULL);
+        return (*alias)->getCommand();
+      }
+    }
+
+    const ShellCommandClass* cmdClass = ShellCommandClass::getCommandClass(strings[0]);
+    if (cmdClass != NULL)
+    {
+      const ShellCommand* retCmd;
+      if (strings.size() >= 1)
+        retCmd = ShellCommand::getCommand(strings[1], cmdClass);
+      if (retCmd == NULL && strings.size() >= 2)
+        retCmd = ShellCommand::getCommand(strings[2], cmdClass);
+      return retCmd;
+
+    }
+  }
+
 
   /**
@@ -303,5 +349,5 @@
     {
       PRINTF(1)("Parameter %d not inside of valid ParameterCount %d of Command %s::%s\n",
-    parameter, this->executor->getParamCount(), this->getName(), this->shellClass->getName());
+                parameter, this->executor->getParamCount(), this->getName(), this->shellClass->getName());
     }
     else
Index: /trunk/src/lib/shell/shell_command.h
===================================================================
--- /trunk/src/lib/shell/shell_command.h	(revision 7412)
+++ /trunk/src/lib/shell/shell_command.h	(revision 7413)
@@ -74,5 +74,7 @@
     static void unregisterCommand(const std::string& commandName, const std::string& className);
     static const ShellCommand* const getCommand(const std::string& commandName, const std::string& className);
+    static const ShellCommand* const getCommand(const std::string& commandName, const ShellCommandClass* cmdClass);
     static bool exists(const std::string& commandName, const std::string& className);
+    static const ShellCommand* const getCommandFromInput(const std::string& inputLine);
 
     const ShellCommandClass* const getCommandClass() const { return this->shellClass; };
Index: /trunk/src/lib/shell/shell_completion.cc
===================================================================
--- /trunk/src/lib/shell/shell_completion.cc	(revision 7412)
+++ /trunk/src/lib/shell/shell_completion.cc	(revision 7413)
@@ -57,4 +57,5 @@
     std::string completeString = "";                 //< the string to complete.
     unsigned int parameterBegin = 0;                 //< The SubString-entry, the Parameters begin.
+    const ShellCommand* command = NULL;              //< The Command.
 
 
@@ -82,5 +83,5 @@
     // OBJECT/FUNCTION COMPLETIONS
     else if ((emptyComplete && inputSplits.size() == 1) ||
-              (!emptyComplete && inputSplits.size() == 2))
+             (!emptyComplete && inputSplits.size() == 2))
     {
       classID = ClassList::StringToID(inputSplits.getString(0));
@@ -99,4 +100,9 @@
 
     // Looking for ParameterCompletions.
+    if (completeType == NullCompletion)
+    {
+      if ((command = ShellCommand::getCommandFromInput(input)) != NULL)
+        completeType |= ParamCompletion;
+    }
 
     if (completeType & ClassCompletion)
@@ -108,16 +114,7 @@
     if (completeType & AliasCompletion)
       this->aliasComplete(completeString);
-
-    if (completeType == NullCompletion)
-    {
-      const ShellCommand* sc = ShellCommand::getCommand(inputSplits[2], inputSplits[0]);
-      if (sc != NULL)
-      {
-        std::vector<std::string> completed;
-        sc->getCompletorPlugin(0)->addToCompleteList(completed, inputSplits[inputSplits.size()-1]);
-        for (unsigned int i = 0; i < completed.size(); i++)
-          this->completionList.push_back(CompletionElement(completed[i], ParamCompletion));
-      }
-    }
+    if (completeType & ParamCompletion)
+      this->paramComplete(completeString, command);
+
 
 
@@ -157,5 +154,4 @@
     std::list<std::string> fktList;
     ShellCommandClass::getCommandListOfClass(className, fktList);
-    //printf("%s\n", boList->firstElement()->getName());
     if (!this->addToCompleteList(fktList, commandBegin, FunctionCompletion))
       return false;
@@ -172,8 +168,20 @@
     std::list<std::string> aliasList;
     ShellCommandAlias::getCommandListOfAlias(aliasList);
-    //printf("%s\n", boList->firstElement()->getName());
     if (!this->addToCompleteList(aliasList, aliasBegin, AliasCompletion))
       return false;
     return true;
+  }
+
+  /**
+   * @brief completes Parameters.
+   * @param paramBegin: Begin of the Parameters.
+   * @returns true on succes, false if something went wrong
+   */
+  bool ShellCompletion::paramComplete(const std::string& paramBegin, const ShellCommand* command)
+  {
+    std::vector<std::string> completed;
+    command->getCompletorPlugin(0)->addToCompleteList(completed, paramBegin);
+      for (unsigned int i = 0; i < completed.size(); i++)
+        this->completionList.push_back(CompletionElement(completed[i], ParamCompletion));
   }
 
@@ -197,14 +205,13 @@
     CompletionElement addElem = completionList.front();
     const std::string& addString = addElem.name;
-    unsigned int addLength = 0;
+    unsigned int addLength = addString.size();
     unsigned int inputLenght = begin.size();
 
-    // Determin the longest Match
-    addLength = addString.size();
-
+    // Determin the longest Match (starting with the first candidate in full length).
     CompletionType changeType = NullCompletion;
     std::vector<CompletionElement>::iterator charIT;
     for (charIT = completionList.begin(); charIT != completionList.end(); charIT++)
     {
+      printf("== %s\n", (*charIT).name.c_str());
       if ((*charIT).type != changeType)
       {
@@ -217,8 +224,5 @@
       for (unsigned int i = inputLenght; i < addLength; i++)
         if (addString[i] != (*charIT).name[i])
-        {
           addLength = i;
-          //       break;
-        }
     }
     PRINT(0)("\n");
Index: /trunk/src/lib/shell/shell_completion.h
===================================================================
--- /trunk/src/lib/shell/shell_completion.h	(revision 7412)
+++ /trunk/src/lib/shell/shell_completion.h	(revision 7413)
@@ -19,4 +19,6 @@
 namespace OrxShell
 {
+  class ShellCommand;
+
   //! A class for Completing the an InputString.
   class ShellCompletion
@@ -54,4 +56,5 @@
       bool commandComplete(const std::string& commandBegin, const std::string& className);
       bool aliasComplete(const std::string& aliasBegin);
+      bool paramComplete(const std::string& paramBegin, const ShellCommand* command);
 
       // Generally Completes.
