[asterisk-commits] junky: branch group/cli_cleanup r145003 - in /team/group/cli_cleanup: channel...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Sep 27 16:27:35 CDT 2008
Author: junky
Date: Sat Sep 27 16:27:34 2008
New Revision: 145003
URL: http://svn.digium.com/view/asterisk?view=rev&rev=145003
Log:
change few cli commands to be consitent
like decided at the cli crew at astridevcon
Modified:
team/group/cli_cleanup/channels/chan_unistim.c
team/group/cli_cleanup/res/res_config_ldap.c
team/group/cli_cleanup/res/res_config_pgsql.c
Modified: team/group/cli_cleanup/channels/chan_unistim.c
URL: http://svn.digium.com/view/asterisk/team/group/cli_cleanup/channels/chan_unistim.c?view=diff&rev=145003&r1=145002&r2=145003
==============================================================================
--- team/group/cli_cleanup/channels/chan_unistim.c (original)
+++ team/group/cli_cleanup/channels/chan_unistim.c Sat Sep 27 16:27:34 2008
@@ -4682,9 +4682,9 @@
switch (cmd) {
case CLI_INIT:
- e->command = "unistim info";
+ e->command = "unistim show info";
e->usage =
- "Usage: unistim info\n"
+ "Usage: unistim show info\n"
" Dump internal structures.\n";
return NULL;
@@ -4751,27 +4751,27 @@
switch (cmd) {
case CLI_INIT:
- e->command = "unistim sp";
+ e->command = "unistim send packet";
e->usage =
- "Usage: unistim sp USTM/line at name hexa\n"
- " unistim sp USTM/1000 at hans 19040004\n";
+ "Usage: unistim send packet USTM/line at name hexa\n"
+ " unistim send packet USTM/1000 at hans 19040004\n";
return NULL;
case CLI_GENERATE:
return NULL; /* no completion */
}
- if (a->argc < 4)
+ if (a->argc < 5)
return CLI_SHOWUSAGE;
- if (strlen(a->argv[2]) < 9)
+ if (strlen(a->argv[3]) < 9)
return CLI_SHOWUSAGE;
- len = strlen(a->argv[3]);
+ len = strlen(a->argv[4]);
if (len % 2)
return CLI_SHOWUSAGE;
- ast_copy_string(tmp, a->argv[2] + 5, sizeof(tmp));
+ ast_copy_string(tmp, a->argv[3] + 5, sizeof(tmp));
sub = find_subchannel_by_name(tmp);
if (!sub) {
ast_cli(a->fd, "Can't find '%s'\n", tmp);
@@ -4781,15 +4781,15 @@
ast_cli(a->fd, "'%s' is not connected\n", tmp);
return CLI_SUCCESS;
}
- ast_cli(a->fd, "Sending '%s' to %s (%p)\n", a->argv[3], tmp, sub->parent->parent->session);
+ ast_cli(a->fd, "Sending '%s' to %s (%p)\n", a->argv[4], tmp, sub->parent->parent->session);
for (i = 0; i < len; i++) {
- c = a->argv[3][i];
+ c = a->argv[4][i];
if (c >= 'a')
c -= 'a' - 10;
else
c -= '0';
i++;
- cc = a->argv[3][i];
+ cc = a->argv[4][i];
if (cc >= 'a')
cc -= 'a' - 10;
else
Modified: team/group/cli_cleanup/res/res_config_ldap.c
URL: http://svn.digium.com/view/asterisk/team/group/cli_cleanup/res/res_config_ldap.c?view=diff&rev=145003&r1=145002&r2=145003
==============================================================================
--- team/group/cli_cleanup/res/res_config_ldap.c (original)
+++ team/group/cli_cleanup/res/res_config_ldap.c Sat Sep 27 16:27:34 2008
@@ -1529,9 +1529,9 @@
switch (cmd) {
case CLI_INIT:
- e->command = "realtime ldap status";
+ e->command = "realtime show ldap status";
e->usage =
- "Usage: realtime ldap status\n"
+ "Usage: realtime show ldap status\n"
" Shows connection information for the LDAP RealTime driver\n";
return NULL;
case CLI_GENERATE:
Modified: team/group/cli_cleanup/res/res_config_pgsql.c
URL: http://svn.digium.com/view/asterisk/team/group/cli_cleanup/res/res_config_pgsql.c?view=diff&rev=145003&r1=145002&r2=145003
==============================================================================
--- team/group/cli_cleanup/res/res_config_pgsql.c (original)
+++ team/group/cli_cleanup/res/res_config_pgsql.c Sat Sep 27 16:27:34 2008
@@ -1289,13 +1289,13 @@
switch (cmd) {
case CLI_INIT:
- e->command = "realtime pgsql cache";
+ e->command = "realtime show pgsql cache";
e->usage =
- "Usage: realtime pgsql cache [<table>]\n"
+ "Usage: realtime show pgsql cache [<table>]\n"
" Shows table cache for the PostgreSQL RealTime driver\n";
return NULL;
case CLI_GENERATE:
- if (a->argc != 3) {
+ if (a->argc != 4) {
return NULL;
}
l = strlen(a->word);
@@ -1311,25 +1311,25 @@
return ret;
}
- if (a->argc == 3) {
+ if (a->argc == 4) {
/* List of tables */
AST_LIST_LOCK(&psql_tables);
AST_LIST_TRAVERSE(&psql_tables, cur, list) {
ast_cli(a->fd, "%s\n", cur->name);
}
AST_LIST_UNLOCK(&psql_tables);
- } else if (a->argc == 4) {
+ } else if (a->argc == 5) {
/* List of columns */
- if ((cur = find_table(a->argv[3]))) {
+ if ((cur = find_table(a->argv[4]))) {
struct columns *col;
- ast_cli(a->fd, "Columns for Table Cache '%s':\n", a->argv[3]);
+ ast_cli(a->fd, "Columns for Table Cache '%s':\n", a->argv[4]);
ast_cli(a->fd, "%-20.20s %-20.20s %-3.3s %-8.8s\n", "Name", "Type", "Len", "Nullable");
AST_LIST_TRAVERSE(&cur->columns, col, list) {
ast_cli(a->fd, "%-20.20s %-20.20s %3d %-8.8s\n", col->name, col->type, col->len, col->notnull ? "NOT NULL" : "");
}
ast_mutex_unlock(&cur->lock);
} else {
- ast_cli(a->fd, "No such table '%s'\n", a->argv[3]);
+ ast_cli(a->fd, "No such table '%s'\n", a->argv[4]);
}
}
return 0;
@@ -1342,16 +1342,16 @@
switch (cmd) {
case CLI_INIT:
- e->command = "realtime pgsql status";
+ e->command = "realtime show pgsql status";
e->usage =
- "Usage: realtime pgsql status\n"
+ "Usage: realtime show pgsql status\n"
" Shows connection information for the PostgreSQL RealTime driver\n";
return NULL;
case CLI_GENERATE:
return NULL;
}
- if (a->argc != 3)
+ if (a->argc != 4)
return CLI_SHOWUSAGE;
if (pgsqlConn && PQstatus(pgsqlConn) == CONNECTION_OK) {
More information about the asterisk-commits
mailing list