X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fccanlint%2Fccanlint.c;h=8aa9f2894c4aa83e053692c560b0bb6e74a5a6ea;hb=ed776b635be5cde9bcda9569789fba487f4e7cca;hp=fb3e4d140fe378108f23b4d0042f5ec41a6fd645;hpb=13c2e75f28189c87d527c0c752de549f21cf505d;p=ccan diff --git a/tools/ccanlint/ccanlint.c b/tools/ccanlint/ccanlint.c index fb3e4d14..8aa9f289 100644 --- a/tools/ccanlint/ccanlint.c +++ b/tools/ccanlint/ccanlint.c @@ -59,7 +59,7 @@ static void indent_print(const char *string) bool ask(const char *question) { - char reply[2]; + char reply[80]; printf("%s ", question); fflush(stdout); @@ -149,11 +149,13 @@ static bool run_test(struct ccanlint *i, printf("\n"); } - if (!quiet && !score->pass) { + if ((!quiet && !score->pass) || verbose) { struct file_error *f; + unsigned int lines = 1; if (score->error) - printf("%s:\n", score->error); + printf("%s%s\n", score->error, + list_empty(&score->per_file_errors) ? "" : ":"); list_for_each(&score->per_file_errors, f, list) { if (f->line) @@ -163,8 +165,12 @@ static bool run_test(struct ccanlint *i, printf("%s:%s\n", f->file->fullname, f->error); else printf("%s\n", f->error); + if (verbose < 2 && ++lines > 5) { + printf("... more (use -vv to see them all)\n"); + break; + } } - if (i->handle) + if (!quiet && !score->pass && i->handle) i->handle(m, score); }