Index: /trunk/src/lib/lang/class_list.cc
===================================================================
--- /trunk/src/lib/lang/class_list.cc	(revision 5193)
+++ /trunk/src/lib/lang/class_list.cc	(revision 5194)
@@ -289,5 +289,5 @@
  * @return a String containing the name of the Class, NULL if the Class was not found
  */
-const char* ClassList::IDToString(ClassID classID)
+const char* ClassList::IDToString(long classID)
 {
   if(likely(ClassList::first != NULL))
Index: /trunk/src/lib/lang/class_list.h
===================================================================
--- /trunk/src/lib/lang/class_list.h	(revision 5193)
+++ /trunk/src/lib/lang/class_list.h	(revision 5194)
@@ -46,5 +46,5 @@
     static void                     whatIs(const BaseObject* object);
 
-    static const char*              IDToString(ClassID classID = CL_NULL);
+    static const char*              IDToString(long classID = CL_NULL);
     static long                     StringToID(const char* className);
     static void                     debug(unsigned int debugLevel = 0, long classID = CL_NULL);
Index: /trunk/src/lib/shell/shell_completion.cc
===================================================================
--- /trunk/src/lib/shell/shell_completion.cc	(revision 5193)
+++ /trunk/src/lib/shell/shell_completion.cc	(revision 5194)
@@ -19,4 +19,5 @@
 
 #include "shell_input.h"
+#include "shell_command.h"
 
 #include "substring.h"
@@ -64,13 +65,11 @@
 bool ShellCompletion::autoComplete(ShellInput* input)
 {
-  const char* completionLine;
+  const char* completionLine;      //< the inputLine we complete.
 
   long classID;                    //< the classID retrieved from the Class.
   tList<BaseObject>* objectList;   //< the list of Objects stored in classID
   bool emptyComplete = false;      //< if the completion input is empty string. e.g ""
-  SHELLC_TYPE firstType = SHELLC_NONE;
-  SHELLC_TYPE secondType = SHELLC_NONE;
-  long completeType = SHELLC_NONE;
-  const char* completeString;
+  long completeType = SHELLC_NONE; //< the Type we'd like to complete.
+  const char* completeString;      //< the string to complete.
 
 
@@ -123,12 +122,22 @@
   {
     classID = ClassList::StringToID(inputSplits.getString(0));
+    objectList = ClassList::getList(classID);
     if (classID == CL_NULL)
-    {
       return false;
-    }
     else
     {
+      if (objectList != NULL && objectList->getSize() == 1)
+        completeType |= SHELLC_FUNCTION;
       completeType |= SHELLC_OBJECT;
     }
+  }
+  else if ((inputSplits.getCount() == 2 && emptyComplete == true) ||
+            (inputSplits.getCount() == 3 && emptyComplete == false))
+  {
+    classID = ClassList::StringToID(inputSplits.getString(0));
+    if (classID == CL_NULL)
+      return false;
+    else
+     completeType |= SHELLC_FUNCTION;
   }
 
@@ -137,9 +146,10 @@
   if (completeType & SHELLC_OBJECT)
     this->objectComplete(completeString, classID);
-
-  if (emptyComplete == false)
-    this->generalComplete(inputSplits.getString(inputSplits.getCount()-1));
-  else
-    this->generalComplete("");
+  if (completeType & SHELLC_FUNCTION)
+    this->functionComplete(completeString, classID);
+
+
+  this->generalComplete(completeString);
+  return true;
 }
 
@@ -190,6 +200,14 @@
  * @param functionBegin the beginning of the function String
  */
-bool ShellCompletion::functionComplete(const char* functionBegin)
-{
+bool ShellCompletion::functionComplete(const char* functionBegin, long classID)
+{
+  if (unlikely(functionBegin == NULL))
+    return false;
+  tList<const char> fktList;
+  ShellCommandClass::getCommandListOfClass(ClassList::IDToString(classID), &fktList);
+  //printf("%s\n", boList->firstElement()->getName());
+  if (!this->addToCompleteList(&fktList, functionBegin))
+    return false;
+  return true;
 }
 
Index: /trunk/src/lib/shell/shell_completion.h
===================================================================
--- /trunk/src/lib/shell/shell_completion.h	(revision 5193)
+++ /trunk/src/lib/shell/shell_completion.h	(revision 5194)
@@ -40,5 +40,5 @@
   bool objectComplete(const char* objectBegin, long classID);
   bool objectMatch(const char* objectBegin, long classID, unsigned int* length);
-  bool functionComplete(const char* functionBegin);
+  bool functionComplete(const char* functionBegin, long classID);
   bool functionMatch(const char* functionBegin, long classID, unsigned int* length);
 
