X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=progs%2Finfocmp.c;h=7b52dded11c65a40776f9a0047673e75b63533e6;hp=8d2cabeed1898e84e854fc27c69c0b8acf694f34;hb=01433b4eede468929bccc74b22324cb44540e990;hpb=d4d1d81ab6fc1ad681ff120d925099f947fefcf3 diff --git a/progs/infocmp.c b/progs/infocmp.c index 8d2cabee..7b52dded 100644 --- a/progs/infocmp.c +++ b/progs/infocmp.c @@ -42,7 +42,7 @@ #include -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;