From 2e756d0bbf38c1f2205a724ec40e885c1685e24e Mon Sep 17 00:00:00 2001 From: Ward Wouts Date: Tue, 5 Jul 2005 12:58:20 +0000 Subject: [PATCH] new features --- list_same/list_same | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/list_same/list_same b/list_same/list_same index 88b897e..d7e467d 100755 --- a/list_same/list_same +++ b/list_same/list_same @@ -6,11 +6,13 @@ # Generates a list of files in cur. dir which are actually the same # Compares size and MD5 checksum # Handy for cleaning up pictures like this: -# list_same -es | xargs rm +# list_same -sd # wishlist: # - entering a list of file to check on the commandline # - option to ignore 0 length files +# - recurse through directories +# - hardlink same files use strict; use Digest::MD5; @@ -33,13 +35,18 @@ if ( $opts{m} ) { # functions sub cmdline { - getopts('dehms', \%opts); + getopts('dehlms', \%opts); if ( $opts{h} ) { &help; } map { if ( -d $_ ) { s/\/$//; push @dirs, $_; } else { die "$_ not a directory" } } @ARGV; if ( scalar @dirs == 0 ) { 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; } @@ -249,6 +256,8 @@ Usage: $name [OPTION] ... -d delete resulting files -e escape output filenames with backslashes -h display this help message + -l hardlink resulting files (no change if on + different filesystems) -m mp3 compare, ignores ID3 tags (slow) -s skip the first entry for doubles