|
|
@ -306,6 +306,7 @@ static int database_show(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 == 4) {
|
|
|
|
if (argc == 4) {
|
|
|
|
/* Family and key tree */
|
|
|
|
/* Family and key tree */
|
|
|
@ -342,10 +343,12 @@ static int database_show(int fd, int argc, char *argv[])
|
|
|
|
values = "<bad value>";
|
|
|
|
values = "<bad value>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (keymatch(keys, prefix)) {
|
|
|
|
if (keymatch(keys, prefix)) {
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -387,8 +390,8 @@ static int database_showkey(int fd, int argc, char *argv[])
|
|
|
|
values = "<bad value>";
|
|
|
|
values = "<bad value>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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++;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ast_mutex_unlock(&dblock);
|
|
|
|
ast_mutex_unlock(&dblock);
|
|
|
|