mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
Make the database show command spit out how many results it got. (issue #9332 reported by junky)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@59080 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -358,6 +358,7 @@ static int database_showkey(int fd, int argc, char *argv[])
|
|||||||
char *keys, *values;
|
char *keys, *values;
|
||||||
int res;
|
int res;
|
||||||
int pass;
|
int pass;
|
||||||
|
int counter = 0;
|
||||||
|
|
||||||
if (argc == 3) {
|
if (argc == 3) {
|
||||||
/* Key only */
|
/* Key only */
|
||||||
@@ -389,9 +390,11 @@ static int database_showkey(int fd, int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
if (subkeymatch(keys, suffix)) {
|
if (subkeymatch(keys, suffix)) {
|
||||||
ast_cli(fd, "%-50s: %-25s\n", keys, values);
|
ast_cli(fd, "%-50s: %-25s\n", keys, values);
|
||||||
|
counter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ast_mutex_unlock(&dblock);
|
ast_mutex_unlock(&dblock);
|
||||||
|
ast_cli(fd, "%d results found.\n", counter);
|
||||||
return RESULT_SUCCESS;
|
return RESULT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user