Index: pbx.c =================================================================== RCS file: /usr/cvsroot/asterisk/pbx.c,v retrieving revision 1.308 diff -u -r1.308 pbx.c --- pbx.c 30 Nov 2005 08:49:59 -0000 1.308 +++ pbx.c 3 Dec 2005 02:43:28 -0000 @@ -1163,13 +1163,39 @@ { struct ast_custom_function *acf; int count_acf = 0; + int like = 0; - ast_cli(fd, "Installed Custom Functions:\n--------------------------------------------------------------------------------\n"); + if ( argc == 4 && (!strcmp(argv[2], "like")) ) { + like=1; + } + + if ( like ) { + ast_cli(fd, "Matching Custom Functions:\n--------------------------------------------------------------------------------\n"); + } else { + ast_cli(fd, "Installed Custom Functions:\n--------------------------------------------------------------------------------\n"); + } for (acf = acf_root ; acf; acf = acf->next) { - ast_cli(fd, "%-20.20s %-35.35s %s\n", acf->name, acf->syntax, acf->synopsis); - count_acf++; + int print_acf = 0; + if ( like ) { + if (strstr(acf->name,argv[3])) { + print_acf=1; + count_acf++; + } + } else { + print_acf=1; + count_acf++; + } + + if (print_acf) { + ast_cli(fd, "%-20.20s %-35.35s %s\n", acf->name, acf->syntax, acf->synopsis); + } + + } + if ( like ) { + ast_cli(fd, "%d custom functions matching your criteria.\n", count_acf); + } else { + ast_cli(fd, "%d custom functions installed.\n", count_acf); } - ast_cli(fd, "%d custom functions installed.\n", count_acf); return 0; }