show whole binding (inclusive predefined parameters) and trigger count _per bind_
[NeonServV5.git] / src / cmd_global_commands.c
index 10b2c4b4628888e71edcc58e9ec5dc7e294e2e3d..e0cfba056a836031ccb7bbc1f21252ca19ffd804 100644 (file)
@@ -52,6 +52,8 @@ CMD_BIND(global_cmd_commands) {
     char caccess[5];
     char gaccess[5];
     char triggered[10];
+    char funcname[MAXLEN];
+    int funcpos;
     for(i = 0; i < bindcount; i++) {
         cbind = binds[i];
         content[0] = cbind->cmd;
@@ -59,9 +61,16 @@ CMD_BIND(global_cmd_commands) {
         content[1] = caccess;
         sprintf(gaccess, "%d", global_cmd_commands_operaccess(cbind));
         content[2] = gaccess;
-        sprintf(triggered, "%d", cbind->func->triggered);
+        sprintf(triggered, "%d", cbind->triggered);
         content[3] = triggered;
-        content[4] = cbind->func->name;
+        funcpos = sprintf(funcname, "%s", cbind->func->name);
+        if(cbind->paramcount) {
+            int j;
+            for(j = 0; j < cbind->paramcount; j++) {
+                funcpos += sprintf(funcname + funcpos, " %s", cbind->parameters[j]);
+            }
+        }
+        content[4] = funcname;
         table_add(table, content);
     }
     //send the table