add count to 'show functions' CLI command (issue #4991)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2-netsec
Kevin P. Fleming 20 years ago
parent 971091a17c
commit 26ea6ea391

@ -1124,12 +1124,14 @@ icky:
static int handle_show_functions(int fd, int argc, char *argv[]) static int handle_show_functions(int fd, int argc, char *argv[])
{ {
struct ast_custom_function *acf; struct ast_custom_function *acf;
int count_acf = 0;
ast_cli(fd, "Installed Custom Functions:\n--------------------------------------------------------------------------------\n"); ast_cli(fd, "Installed Custom Functions:\n--------------------------------------------------------------------------------\n");
for (acf = acf_root ; acf; acf = acf->next) { for (acf = acf_root ; acf; acf = acf->next) {
ast_cli(fd, "%-20.20s %-35.35s %s\n", acf->name, acf->syntax, acf->synopsis); ast_cli(fd, "%-20.20s %-35.35s %s\n", acf->name, acf->syntax, acf->synopsis);
count_acf++;
} }
ast_cli(fd, "\n"); ast_cli(fd, "%d custom functions installed.\n", count_acf);
return 0; return 0;
} }

Loading…
Cancel
Save