diff --git a/src/imdb-query.c b/src/imdb-query.c index edcc1d1..b9a7bb5 100644 --- a/src/imdb-query.c +++ b/src/imdb-query.c @@ -33,6 +33,7 @@ void usage(int exitcode) { " -D , Show difference bitmap for this samples\n" " -S Search for images similar ot this sample\n" " -U Show db usage map, entries per column\n" +" Special case - 0, output will be single line\n" ); exit(exitcode); } @@ -83,6 +84,13 @@ int db_usage_map(imdb_db_t *db, unsigned short int cols) return 0; } + if (cols == 0) { + putchar(CHAR_NONE); /* zero */ + puts(map); + FREE(map); + return 0; + } + m = map; while (records) { rest = (records > cols) ? cols : records; @@ -200,8 +208,8 @@ int main(int argc, char **argv) case 'U' : mode = usage_map; cols = atoi(optarg); - if (cols <= 0 || cols >= 256) - cols = 64; + if (cols >= 256) + cols = 100; break; default : usage(EXIT_FAILURE);