ccanlint: only print 5 lines of output unless -vv
authorRusty Russell <rusty@rustcorp.com.au>
Sun, 14 Nov 2010 11:53:52 +0000 (22:23 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Sun, 14 Nov 2010 11:53:52 +0000 (22:23 +1030)
tools/ccanlint/ccanlint.c

index a5901ac318b8b00b0a160457e0f51d4370d32f4c..8aa9f2894c4aa83e053692c560b0bb6e74a5a6ea 100644 (file)
@@ -151,6 +151,7 @@ static bool run_test(struct ccanlint *i,
 
        if ((!quiet && !score->pass) || verbose) {
                struct file_error *f;
+               unsigned int lines = 1;
 
                if (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);
                        else
                                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)
                        i->handle(m, score);