From 9f4ff8814b0ec014d894a626956a58feb71398bb Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 23 Feb 2007 20:32:31 +0000 Subject: [PATCH] Breaking change: show command with no arguments now returns the usage syntax instead of the list of all registered interfaces. show api and show application now does not display items with no description set in their interface structs, allowing you to have "hidden" api's and applications, for example to keep an old api name for something for backwards compatibility sake, but you do not want it to show up in the help commands. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4377 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/applications/mod_commands/mod_commands.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 6a18d0b375..71d7ef735f 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -621,11 +621,12 @@ static switch_status_t show_function(char *cmd, switch_core_session_t *session, // If you changes the field qty or order of any of these select // statmements, you must also change show_callback and friends to match! if (!cmd) { - sprintf (sql, "select * from interfaces"); + stream->write_function(stream, "USAGE: %s\n", show_api_interface.syntax); + return SWITCH_STATUS_SUCCESS; } else if ( !strcmp(cmd,"codec") || !strcmp(cmd,"dialplan") || !strcmp(cmd,"file") || !strcmp(cmd,"timer")) { sprintf (sql, "select type, name from interfaces where type = '%s'", cmd); } else if (!strcmp(cmd,"application") || !strcmp(cmd,"api")) { - sprintf (sql, "select name, description, syntax from interfaces where type = '%s'", cmd); + sprintf (sql, "select name, description, syntax from interfaces where type = '%s' and description != ''" , cmd); } else if ( !strcmp(cmd,"calls")) { sprintf (sql, "select * from calls"); } else if ( !strcmp(cmd,"channels")) { @@ -779,7 +780,7 @@ static switch_api_interface_t show_api_interface = { /*.interface_name */ "show", /*.desc */ "Show", /*.function */ show_function, - /*.syntax */ "|codec|application|api|dialplan|file|timer|calls|channels", + /*.syntax */ "codec|application|api|dialplan|file|timer|calls|channels", /*.next */ &status_api_interface };