diff options
author | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-09-10 16:24:29 +0000 |
---|---|---|
committer | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-09-10 16:24:29 +0000 |
commit | 4d237dbf0fbbbf284078cfebb3275030e5a54365 (patch) | |
tree | 3439f48a618144bba8308c3af122dfef5cfa9655 /main/db.c | |
parent | cd0865e4530da31064b84c1f1076c0addbdcf08a (diff) |
Add counter to 'database show' CLI command.
(also a minor whitespace change that I found along the way)
Closes issue #10683, patch by junky
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82125 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/db.c')
-rw-r--r-- | main/db.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -306,6 +306,7 @@ static int database_show(int fd, int argc, char *argv[]) char *keys, *values; int res; int pass; + int counter = 0; if (argc == 4) { /* Family and key tree */ @@ -342,10 +343,12 @@ static int database_show(int fd, int argc, char *argv[]) values = "<bad value>"; } if (keymatch(keys, prefix)) { - ast_cli(fd, "%-50s: %-25s\n", keys, values); + ast_cli(fd, "%-50s: %-25s\n", keys, values); + counter++; } } ast_mutex_unlock(&dblock); + ast_cli(fd, "%d results found.\n", counter); return RESULT_SUCCESS; } @@ -387,8 +390,8 @@ static int database_showkey(int fd, int argc, char *argv[]) values = "<bad value>"; } if (subkeymatch(keys, suffix)) { - ast_cli(fd, "%-50s: %-25s\n", keys, values); - counter++; + ast_cli(fd, "%-50s: %-25s\n", keys, values); + counter++; } } ast_mutex_unlock(&dblock); |