new features

This commit is contained in:
Ward Wouts 2005-07-05 12:58:20 +00:00
parent 0e065b0eb4
commit 2e756d0bbf

View file

@ -6,11 +6,13 @@
# Generates a list of files in cur. dir which are actually the same # Generates a list of files in cur. dir which are actually the same
# Compares size and MD5 checksum # Compares size and MD5 checksum
# Handy for cleaning up pictures like this: # Handy for cleaning up pictures like this:
# list_same -es | xargs rm # list_same -sd
# wishlist: # wishlist:
# - entering a list of file to check on the commandline # - entering a list of file to check on the commandline
# - option to ignore 0 length files # - option to ignore 0 length files
# - recurse through directories
# - hardlink same files
use strict; use strict;
use Digest::MD5; use Digest::MD5;
@ -33,13 +35,18 @@ if ( $opts{m} ) {
# functions # functions
sub cmdline { sub cmdline {
getopts('dehms', \%opts); getopts('dehlms', \%opts);
if ( $opts{h} ) { &help; } if ( $opts{h} ) { &help; }
map { if ( -d $_ ) { s/\/$//; push @dirs, $_; } else { die "$_ not a directory" } } @ARGV; map { if ( -d $_ ) { s/\/$//; push @dirs, $_; } else { die "$_ not a directory" } } @ARGV;
if ( scalar @dirs == 0 ) { if ( scalar @dirs == 0 ) {
push @dirs, "."; push @dirs, ".";
} }
if ( $opts{l} && ( $opts{e} || $opts{d} || $opts{s} ) ) {
print "-l doens't combine with -d, -e or -s\n\n";
&help;
}
# map { print "$_\n"; } @dirs; # map { print "$_\n"; } @dirs;
} }
@ -249,6 +256,8 @@ Usage: $name [OPTION] ...
-d delete resulting files -d delete resulting files
-e escape output filenames with backslashes -e escape output filenames with backslashes
-h display this help message -h display this help message
-l hardlink resulting files (no change if on
different filesystems)
-m mp3 compare, ignores ID3 tags (slow) -m mp3 compare, ignores ID3 tags (slow)
-s skip the first entry for doubles -s skip the first entry for doubles