Make the database show command spit out how many results it got. (issue #9332 reported by junky)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@59080 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
04e530983c
commit
cc9533e362
|
@ -358,6 +358,7 @@ static int database_showkey(int fd, int argc, char *argv[])
|
|||
char *keys, *values;
|
||||
int res;
|
||||
int pass;
|
||||
int counter = 0;
|
||||
|
||||
if (argc == 3) {
|
||||
/* Key only */
|
||||
|
@ -389,9 +390,11 @@ static int database_showkey(int fd, int argc, char *argv[])
|
|||
}
|
||||
if (subkeymatch(keys, suffix)) {
|
||||
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