I've sent the attached patch, which implements this request vi the "-b" option, upstream for review. If I haven't heard back in the next week or two, I'll probably go ahead and include it in the next upload.
diff -urN diffstat-1.44.orig/diffstat.1 diffstat-1.44/diffstat.1 --- diffstat-1.44.orig/diffstat.1 2005-08-15 18:55:59.000000000 -0500 +++ diffstat-1.44/diffstat.1 2007-08-30 21:58:51.000000000 -0500 @@ -56,6 +56,9 @@ \fBdiffstat\fP reads the differences from the standard input. .SH OPTIONS .TP +.B -b +ignore lines matching "Binary files XXX and YYY differ" in the diff +.TP .B -c prefix each line of output with "#", making it a comment-line for shell scripts. diff -urN diffstat-1.44.orig/diffstat.c diffstat-1.44/diffstat.c --- diffstat-1.44.orig/diffstat.c 2007-08-26 13:59:23.000000000 -0500 +++ diffstat-1.44/diffstat.c 2007-08-30 21:58:47.000000000 -0500 @@ -275,6 +275,7 @@ static int trace_opt = 0; /* if nonzero, write debugging information */ static int sort_names = 1; /* true if we sort filenames */ static int verbose = 0; /* -q/-v options */ +static int suppress_binary = 0; /* -b option */ static long plot_scale; /* the effective scale (1:maximum) */ #ifdef HAVE_TSEARCH @@ -1369,6 +1370,9 @@ } else if (names_only) { printf("%s\n", name); } else { + if (p->cmt == Binary && suppress_binary == 1) { + return; + } printf("%s %-*.*s|", comment_opt, name_wide, name_wide, @@ -1578,9 +1582,12 @@ max_width = 80; - while ((j = getopt_helper(argc, argv, "cde:f:hkln:o:p:r:tuvVw:", 'h', 'V')) + while ((j = getopt_helper(argc, argv, "bcde:f:hkln:o:p:r:tuvVw:", 'h', 'V')) != -1) { switch (j) { + case 'b': + suppress_binary = 1; + break; case 'c': comment_opt = "#"; break;
signature.asc
Description: Digital signature