diff options
-rwxr-xr-x | checkem | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -25,7 +25,7 @@ use File::Find; use Digest; # Version number to make Perl::Critic happy -our $VERSION = 2.10; +our $VERSION = 2.11; # If no arguments, work with the current working directory if ( !@ARGV ) { @@ -119,8 +119,12 @@ for my $fs ( grep { @{$_} > 1 } values %sizes ) { } # Print the groups of matched files (more than one share a checksum in the -# final table); apply gratuitous sorts, just so the output remains the same for -# identical file sets -for my $dig ( sort grep { @{ $sums{$_} } > 1 } keys %sums ) { - printf "%s\n\n", join "\n", sort map { $_->{name} } @{ $sums{$dig} }; +# final table); sort the blocks by the filesize, and the files within each +# block by name +for my $group ( + sort { $a->[0]{size} <=> $b->[0]{size} } + grep { @{$_} > 1 } values %sums + ) +{ + printf "%s\n\n", join "\n", sort map { $_->{name} } @{$group}; } |