]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - progs/infocmp.c
ncurses 5.9 - patch 20111231
[ncurses.git] / progs / infocmp.c
index 8d2cabeed1898e84e854fc27c69c0b8acf694f34..7b52dded11c65a40776f9a0047673e75b63533e6 100644 (file)
@@ -42,7 +42,7 @@
 
 #include <dump_entry.h>
 
-MODULE_ID("$Id: infocmp.c,v 1.108 2011/08/06 16:36:06 tom Exp $")
+MODULE_ID("$Id: infocmp.c,v 1.110 2011/12/17 23:59:50 tom Exp $")
 
 #define L_CURL "{"
 #define R_CURL "}"
@@ -1251,6 +1251,23 @@ terminal_env(void)
     return terminal;
 }
 
+/*
+ * Show the databases that infocmp knows about.  The location to which it writes is
+ */
+static void
+show_databases(void)
+{
+    DBDIRS state;
+    int offset;
+    const char *path2;
+
+    _nc_first_db(&state, &offset);
+    while ((path2 = _nc_next_db(&state, &offset)) != 0) {
+       printf("%s\n", path2);
+    }
+    _nc_last_db();
+}
+
 /***************************************************************************
  *
  * Main sequence
@@ -1302,7 +1319,7 @@ main(int argc, char *argv[])
 
     while ((c = getopt(argc,
                       argv,
-                      "01A:aB:CcdEeFfGgIiKLlnpqR:rs:TtUuVv:w:x")) != -1) {
+                      "01A:aB:CcDdEeFfGgIiKLlnpqR:rs:TtUuVv:w:x")) != -1) {
        switch (c) {
        case '0':
            mwidth = 65535;
@@ -1337,6 +1354,11 @@ main(int argc, char *argv[])
                sortmode = S_TERMCAP;
            break;
 
+       case 'D':
+           show_databases();
+           ExitProgram(EXIT_SUCCESS);
+           break;
+
        case 'c':
            compare = C_COMMON;
            break;