diff options
-rw-r--r-- | sm.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -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); } } |