Browse Source

ccanlint: only print 5 lines of output unless -vv

Rusty Russell 15 years ago
parent
commit
f9b11b0dff
1 changed files with 5 additions and 0 deletions
  1. 5 0
      tools/ccanlint/ccanlint.c

+ 5 - 0
tools/ccanlint/ccanlint.c

@@ -151,6 +151,7 @@ static bool run_test(struct ccanlint *i,
 
 
 	if ((!quiet && !score->pass) || verbose) {
 	if ((!quiet && !score->pass) || verbose) {
 		struct file_error *f;
 		struct file_error *f;
+		unsigned int lines = 1;
 
 
 		if (score->error)
 		if (score->error)
 			printf("%s%s\n", score->error,
 			printf("%s%s\n", score->error,
@@ -164,6 +165,10 @@ static bool run_test(struct ccanlint *i,
 				printf("%s:%s\n", f->file->fullname, f->error);
 				printf("%s:%s\n", f->file->fullname, f->error);
 			else
 			else
 				printf("%s\n", f->error);
 				printf("%s\n", f->error);
+			if (verbose < 2 && ++lines > 5) {
+				printf("... more (use -vv to see them all)\n");
+				break;
+			}
 		}
 		}
 		if (!quiet && !score->pass && i->handle)
 		if (!quiet && !score->pass && i->handle)
 			i->handle(m, score);
 			i->handle(m, score);