mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-09 11:28:25 +00:00
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: https://origsvn.digium.com/svn/asterisk/trunk@82125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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 */
|
||||
@@ -343,9 +344,11 @@ static int database_show(int fd, int argc, char *argv[])
|
||||
}
|
||||
if (keymatch(keys, prefix)) {
|
||||
ast_cli(fd, "%-50s: %-25s\n", keys, values);
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
ast_mutex_unlock(&dblock);
|
||||
ast_cli(fd, "%d results found.\n", counter);
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user