synccompare: normalize directory
Passing a single directory with items inside was not supported yet. Only comparison was able to read such items. This patch adds the same feature to the single argument case.
This commit is contained in:
parent
9094edd765
commit
e426108e11
1 changed files with 6 additions and 1 deletions
|
@ -799,7 +799,12 @@ if($#ARGV > 1) {
|
|||
# normalize
|
||||
my $in;
|
||||
if( $#ARGV >= 0 ) {
|
||||
open(IN, "<$ARGV[0]") || die "$ARGV[0]: $!";
|
||||
my $file1 = $ARGV[0];
|
||||
if (-d $file1) {
|
||||
open(IN, "-|:utf8", "find $file1 -type f -print0 | xargs -0 cat") || die "$file1: $!";
|
||||
} else {
|
||||
open(IN, "<:utf8", $file1) || die "$file1: $!";
|
||||
}
|
||||
$in = *IN{IO};
|
||||
} else {
|
||||
$in = *STDIN{IO};
|
||||
|
|
Loading…
Reference in a new issue