36,40c36
< #
< # -t thresh sets threshold for ignoring differences (in %)
< # -p sorts differences by % chg (default is alphabetic)
< # -d ignores all distributions
< #
---
> getopts('adn:t:h');
42,43d37
< getopts('dfn:pt:h');
<
47,52c41,46
< print " Options: -d = Ignore distributions\n";
< print " -p = Sort errors by percentage\n";
< print " -h = Diff header info separately from stats\n";
< print " -n <num> = Print top <num> errors (default 20)\n";
< print " -t <num> = Error threshold in percent (default 1)\n\n";
< die -1;
---
> print " Options: -d = Ignore distributions\n";
> print " -a = Sort errors alphabetically (default: by percentage)\n";
> print " -h = Diff header info separately from stats\n";
> print " -n <num> = Print top <num> errors (default 20, 0 for all)\n";
> print " -t <num> = Ignore errors below <num> percent (default 0)\n\n";
> exit;
64c58
< $err_thresh = ($opt_t) ? $opt_t : 0;
---
> $err_thresh = defined($opt_t) ? $opt_t : 0;
67c61
< $omit_count = ($opt_n) ? $opt_n : 20;
---
> $omit_count = defined($opt_n) ? $opt_n : 20;
294c288
< printf("\nLargest $omit_count relative errors (> %d%%):\n\n", $err_thresh);
---
> printf("\nDifferences > %d%%:\n\n", $err_thresh);
296,299c290,293
< $num_errs = 0;
<
< if ($opt_p)
< {
---
> if ($opt_a) {
> # leave stats sorted alphabetically, doesn't make sense to cut them off
> $omit_count = 0;
> } else {
303a298,299
> $num_errs = 0;
>
321c317
< if (++$num_errs >= $omit_count)
---
> if ($omit_count > 0 && ++$num_errs >= $omit_count)
323c319
< print "[... additional errors omitted ...]\n";
---
> print "[... showing top $omit_count errors only, additional errors omitted ...]\n";