[Freeswitch-svn] [commit] r3232 - freeswitch/branches/knhor/trunk/src/mod/applications/mod_commands
Freeswitch SVN
knhor at freeswitch.org
Sun Oct 29 20:15:39 EST 2006
Author: knhor
Date: Sun Oct 29 20:15:38 2006
New Revision: 3232
Modified:
freeswitch/branches/knhor/trunk/src/mod/applications/mod_commands/mod_commands.c
Log:
make the non-http help response more human readable
Modified: freeswitch/branches/knhor/trunk/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/branches/knhor/trunk/src/mod/applications/mod_commands/mod_commands.c (original)
+++ freeswitch/branches/knhor/trunk/src/mod/applications/mod_commands/mod_commands.c Sun Oct 29 20:15:38 2006
@@ -402,7 +402,15 @@
holder->stream->write_function(holder->stream, "<td>");
holder->stream->write_function(holder->stream, "<b>%s</b>%s", columnNames[x], x == (argc - 1) ? "</td></tr>\n" : "</td><td>");
} else {
- holder->stream->write_function(holder->stream, "%s%s", columnNames[x], x == (argc - 1) ? "\n" : ",");
+ switch(x) {
+ case 0: // column 0
+ case 2: // column 2
+ holder->stream->write_function(holder->stream, "%s\n", argv[x]);
+ break;
+ case 1: // column 1
+ holder->stream->write_function(holder->stream, "\t%s ", argv[x]);
+ break;
+ }
}
}
}
@@ -416,7 +424,15 @@
holder->stream->write_function(holder->stream, "<td>");
holder->stream->write_function(holder->stream, "%s%s", argv[x], x == (argc - 1) ? "</td></tr>\n" : "</td><td>");
} else {
- holder->stream->write_function(holder->stream, "%s%s", argv[x], x == (argc - 1) ? "\n" : ",");
+ switch(x) {
+ case 0: // column 0
+ case 2: // column 2
+ holder->stream->write_function(holder->stream, "%s\n", argv[x]);
+ break;
+ case 1: // column 1
+ holder->stream->write_function(holder->stream, "\t%s ", argv[x]);
+ break;
+ }
}
}
@@ -468,9 +484,9 @@
holder.print_title = 0;
if ((cmdname = strchr(cmd, ' ')) != 0) {
*cmdname++ = '\0';
- sprintf (sql, "select name, syntax, description from interfaces where type = 'api' and name = '%s'", cmdname);
+ sprintf (sql, "select name, syntax, description from interfaces where type = 'api' and name = '%s'", cmdname);
} else {
- sprintf (sql, "select name, syntax, description from interfaces where type = 'api'");
+ sprintf (sql, "select description, name, syntax from interfaces where type = 'api'");
}
}
else {
More information about the Freeswitch-svn
mailing list