Index: trunk/src/util/shell_command.h
===================================================================
--- trunk/src/util/shell_command.h	(revision 5152)
+++ trunk/src/util/shell_command.h	(revision 5153)
@@ -33,7 +33,9 @@
 #define   l_STRING_DEFGRAB(i)       this->defaultStrings[i]
 
-// COMMAND REGISTRATION
+//////////////////////////
+// COMMAND REGISTRATION //
+//////////////////////////
 // NO ARGUMENTS
-#define ShellCommandRegister0 \
+#define ShellCommandRegister0() \
   static void registerCommand(const char* commandName, ClassID classID, void (T::*function)()) \
   { \
@@ -51,6 +53,39 @@
   }
 
-// CONSTRUCTORS
-#define ShellCommandConstructor0 \
+#define ShellCommandRegister2(t1,t2) \
+  static void registerCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE), t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT) \
+  { \
+    if (isRegistered(commandName, classID, 2, t1##_PARAM, t2##_PARAM)== true) \
+      return; \
+    new ShellCommand<T>(commandName, classID, function, d1, d2); \
+  }
+
+#define ShellCommandRegister3(t1,t2,t3) \
+  static void registerCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE), t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT, t3##_TYPE d3 = t3##_DEFAULT) \
+  { \
+    if (isRegistered(commandName, classID, 3, t1##_PARAM, t2##_PARAM, t3##_PARAM)== true) \
+      return; \
+    new ShellCommand<T>(commandName, classID, function, d1, d2, d3); \
+  }
+
+#define ShellCommandRegister4(t1,t2,t3,t4) \
+  static void registerCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE), t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT, t3##_TYPE d3 = t3##_DEFAULT, t4##_TYPE d4 = t4##_DEFAULT) \
+  { \
+    if (isRegistered(commandName, classID, 4, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM)== true) \
+      return; \
+    new ShellCommand<T>(commandName, classID, function, d1, d2, d3, d4); \
+  }
+#define ShellCommandRegister5(t1,t2,t3,t4,t5) \
+  static void registerCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE), t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT, t3##_TYPE d3 = t3##_DEFAULT, t4##_TYPE d4 = t4##_DEFAULT, t5##_TYPE d5 = t5##_DEFAULT) \
+  { \
+    if (isRegistered(commandName, classID, 5, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM, t5##_PARAM)== true) \
+      return; \
+    new ShellCommand<T>(commandName, classID, function, d1, d2, d3, d4, d5); \
+  }
+
+//////////////////
+// CONSTRUCTORS //
+/////////////////
+#define ShellCommandConstructor0() \
   void (T::*functionPointer_0)(); \
   ShellCommand(const char* commandName, ClassID classID, void (T::*function)()) \
@@ -68,7 +103,40 @@
   }
 
-
-
-#define ShellCommandExecute0 \
+#define ShellCommandConstructor2(t1,t2) \
+  void (T::*functionPointer_2_##t1##_##t2)(t1##_TYPE, t2##_TYPE); \
+  ShellCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE), t1##_TYPE d1, t2##_TYPE d2) \
+  : ShellCommandBase(commandName, classID, 2, t1##_PARAM, d1, t2##_PARAM, d2) \
+  { \
+    this->functionPointer_2_##t1##_##t2 = function; \
+  }
+
+#define ShellCommandConstructor3(t1,t2,t3) \
+  void (T::*functionPointer_3_##t1##_##t2##_##t3)(t1##_TYPE, t2##_TYPE, t3##_TYPE); \
+  ShellCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE), t1##_TYPE d1, t2##_TYPE d2, t3##_TYPE d3) \
+  : ShellCommandBase(commandName, classID, 3, t1##_PARAM, d1, t2##_PARAM, d2, t3##_PARAM, d3) \
+  { \
+    this->functionPointer_3_##t1##_##t2##_##t3 = function; \
+  }
+
+#define ShellCommandConstructor4(t1,t2,t3,t4) \
+  void (T::*functionPointer_4_##t1##_##t2##_##t3##_##t4)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE); \
+  ShellCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE), t1##_TYPE d1, t2##_TYPE d2, t3##_TYPE d3, t4##_TYPE d4) \
+  : ShellCommandBase(commandName, classID, 4, t1##_PARAM, d1, t2##_PARAM, d2, t3##_PARAM, d3, t4##_PARAM, d4) \
+  { \
+    this->functionPointer_4_##t1##_##t2##_##t3##_##t4 = function; \
+  }
+
+#define ShellCommandConstructor5(t1,t2,t3,t4,t5) \
+  void (T::*functionPointer_5_##t1##_##t2##_##t3##_##t4##_##t5)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE); \
+  ShellCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE), t1##_TYPE d1, t2##_TYPE d2, t3##_TYPE d3, t4##_TYPE d4, t5##_TYPE d5) \
+  : ShellCommandBase(commandName, classID, 5, t1##_PARAM, d1, t2##_PARAM, d2, t3##_PARAM, d3, t4##_PARAM, d4, t5##_PARAM, d5) \
+  { \
+    this->functionPointer_5_##t1##_##t2##_##t3##_##t4##_##t5 = function; \
+  }
+
+///////////////
+// EXECUTION //
+///////////////
+#define ShellCommandExecute0() \
   if (this->paramCount == 0) \
     (dynamic_cast<T*>(object)->*functionPointer_0)()
@@ -77,4 +145,21 @@
    else if (this->paramCount == 1 && this->parameters[0] == t1##_PARAM) \
     (dynamic_cast<T*>(object)->*functionPointer_1_##t1)(t1##_FUNC(parameters, t1##_DEFGRAB(0)))
+
+#define ShellCommandExecute2(t1,t2) \
+   else if (this->paramCount == 2 && this->parameters[0] == t1##_PARAM && this->parameters[1] == t2##_PARAM) \
+    (dynamic_cast<T*>(object)->*functionPointer_2_##t1##_##t2)(t1##_FUNC(sub.getString(0), t1##_DEFGRAB(0)), t2##_FUNC(sub.getString(1), t2##_DEFGRAB(1)))
+
+#define ShellCommandExecute3(t1,t2,t3) \
+   else if (this->paramCount == 3 && this->parameters[0] == t1##_PARAM && this->parameters[1] == t2##_PARAM && this->parameters[2] == t3##_PARAM) \
+    (dynamic_cast<T*>(object)->*functionPointer_3_##t1##_##t2##_##t3)(t1##_FUNC(sub.getString(0), t1##_DEFGRAB(0)), t2##_FUNC(sub.getString(1), t2##_DEFGRAB(1)), t3##_FUNC(sub.getString(2), t3##_DEFGRAB(2)))
+
+#define ShellCommandExecute4(t1,t2,t3,t4) \
+   else if (this->paramCount == 4 && this->parameters[0] == t1##_PARAM && this->parameters[1] == t2##_PARAM && this->parameters[2] == t3##_PARAM && this->parameters[3] == t4##_PARAM) \
+    (dynamic_cast<T*>(object)->*functionPointer_4_##t1##_##t2##_##t3##_##t4)(t1##_FUNC(sub.getString(0), t1##_DEFGRAB(0)), t2##_FUNC(sub.getString(1), t2##_DEFGRAB(1)), t3##_FUNC(sub.getString(2), t3##_DEFGRAB(2)), t4##_FUNC(sub.getString(3), t4##_DEFGRAB(3)))
+
+#define ShellCommandExecute5(t1,t2,t3,t4,t5) \
+   else if (this->paramCount == 5 && this->parameters[0] == t1##_PARAM && this->parameters[1] == t2##_PARAM && this->parameters[2] == t3##_PARAM && this->parameters[3] == t4##_PARAM && this->parameters[4] == t5##_PARAM) \
+    (dynamic_cast<T*>(object)->*functionPointer_5_##t1##_##t2##_##t3##_##t4##_##t5)(t1##_FUNC(sub.getString(0), t1##_DEFGRAB(0)), t2##_FUNC(sub.getString(1), t2##_DEFGRAB(1)), t3##_FUNC(sub.getString(2), t3##_DEFGRAB(2)), t4##_FUNC(sub.getString(3), t4##_DEFGRAB(3)), t5##_FUNC(sub.getString(4), t5##_DEFGRAB(4)))
+
 
 
@@ -126,11 +211,10 @@
     static void unregisterCommand(const char* commandNaame, ClassID classID);
 
+#ifdef FUNCTOR_LIST
+#undef FUNCTOR_LIST
+#endif
+
 #define FUNCTOR_LIST(x) ShellCommandRegister ## x
-//#include "functor_list.h"
-  FUNCTOR_LIST(0);
-  FUNCTOR_LIST(1)(l_INT);
-  FUNCTOR_LIST(1)(l_STRING);
-  FUNCTOR_LIST(1)(l_FLOAT);
-  FUNCTOR_LIST(1)(l_BOOL);
+#include "functor_list.h"
 #undef FUNCTOR_LIST
 
@@ -138,10 +222,5 @@
   private:
 #define FUNCTOR_LIST(x) ShellCommandConstructor ## x
-//#include "functor_list.h"
-  FUNCTOR_LIST(0);
-  FUNCTOR_LIST(1)(l_INT);
-  FUNCTOR_LIST(1)(l_STRING);
-  FUNCTOR_LIST(1)(l_FLOAT);
-  FUNCTOR_LIST(1)(l_BOOL);
+#include "functor_list.h"
 #undef FUNCTOR_LIST
 
@@ -149,13 +228,7 @@
     {
 //      if (parameters != NULL)
-      SubString subLoads(parameters);
-      subLoads.debug();
+      SubString sub(parameters);
 #define FUNCTOR_LIST(x) ShellCommandExecute ## x
-//#include "functor_list.h"
-  FUNCTOR_LIST(0);
-  FUNCTOR_LIST(1)(l_INT);
-  FUNCTOR_LIST(1)(l_STRING);
-  FUNCTOR_LIST(1)(l_FLOAT);
-  FUNCTOR_LIST(1)(l_BOOL);
+#include "functor_list.h"
 #undef FUNCTOR_LIST
     }
