summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sm.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sm.c b/sm.c
index 6358086..3ab7726 100644
--- a/sm.c
+++ b/sm.c
@@ -356,14 +356,26 @@ static void
list(const char *filename)
{
char path[512];
+ char plugstats[NPLUGINS+3];
FILE *f;
- int i;
+ int i, j, k;
+ plugstats[0] = '[';
+ plugstats[NPLUGINS+1] = ']';
if (filename) {
snprintf(path, sizeof(path), "%s/%s", kcontentdir, filename);
cat(path, stdout);
} else for (i = 0; i < ndocdb; i++) {
- printf("%-15s: %s\n", docdb[i]->filename, docdb[i]->title);
+ for (j = 0; j < NPLUGINS; j++) {
+ plugstats[j + 1] = ' ';
+ for (k = 0; k < plugins[j]->nusedby; k++) {
+ if (plugins[j]->usedby[k] == docdb[i]) {
+ plugstats[j + 1] = plugins[j]->name[0] & ~0x20;
+ break;
+ }
+ }
+ }
+ printf("%s %-15s: %s\n", plugstats, docdb[i]->filename, docdb[i]->title);
}
}