summaryrefslogtreecommitdiff
path: root/res/res_config_pgsql.c
diff options
context:
space:
mode:
authorMichiel van Baak <michiel@vanbaak.info>2008-09-28 23:32:14 +0000
committerMichiel van Baak <michiel@vanbaak.info>2008-09-28 23:32:14 +0000
commit90751b16caec323d90ddf7d41db4a25085a3bd76 (patch)
treed5167b9db2e6c55e56def0e52038799c477d3e3d /res/res_config_pgsql.c
parent434c69b7fde58f0613afa8477d5a21e4dc76bf0d (diff)
Merge the cli_cleanup branch.
This work is done by lmadsen, junky and mvanbaak during AstriDevCon. This is the second audit the CLI got, and this time lmadsen made sure he had _ALL_ modules loaded that have CLI commands in them. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@145121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_config_pgsql.c')
-rw-r--r--res/res_config_pgsql.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/res/res_config_pgsql.c b/res/res_config_pgsql.c
index 5ef6cf67b..f7c1f3a6a 100644
--- a/res/res_config_pgsql.c
+++ b/res/res_config_pgsql.c
@@ -1315,13 +1315,13 @@ static char *handle_cli_realtime_pgsql_cache(struct ast_cli_entry *e, int cmd, s
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);
@@ -1337,25 +1337,25 @@ static char *handle_cli_realtime_pgsql_cache(struct ast_cli_entry *e, int cmd, s
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;
@@ -1368,16 +1368,16 @@ static char *handle_cli_realtime_pgsql_status(struct ast_cli_entry *e, int cmd,
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) {