X-Git-Url: https://git.treefish.org/fex.git/blobdiff_plain/7fa382617fbaccc0ce522b2b3adbbee9db5ad227..20150729:/bin/l diff --git a/bin/l b/bin/l index 93c4aca..1389931 100755 --- a/bin/l +++ b/bin/l @@ -22,10 +22,10 @@ $ENV{LC_CTYPE} = 'C'; # parse CLI arguments $opt_l = $opt_i = $opt_t = $opt_s = $opt_a = $opt_r = $opt_d = $opt_n = 0; $opt_L = $opt_N = $opt_c = $opt_u = $opt_S = $opt_R = $opt_z = $opt_h = 0; -$opt_U = 0; +$opt_U = $opt_x = 0; ${'opt_*'} = ${'opt_?'} = 0; $opt_m = $opt_f = $opt_F = $opt_D = ''; -&usage if !getopts('hdnlLNitcuarsUSRz*?m:f:D:F:') || $opt_h; +&usage if !getopts('hdnlLNitcuarsxUSRz*?m:f:D:F:') || $opt_h; $opt_z = 1 unless $opt_R; $opt_l = 1 if $0 eq 'll'; $opt_l = $opt_i = $opt_a = $opt_S = 1 if $0 eq 'lll'; @@ -167,6 +167,12 @@ sub collect { # traverse real subdirs if (-d $f and not -l $f) { $f =~ s:/*$:/:; + # skip other file systems on -x + if ($opt_x) { + my @pd = stat(dirname($f)); + my @sd = stat($f); + next if $pd[0] ne $sd[0]; + } collect(getfiles($f)); } @@ -545,7 +551,7 @@ sub fmatch { sub usage { - my $opts = '[-lastcuidnrzLRNS*] [-f format] [-D X:Y]'; + my $opts = '[-lastcuidnrzLRxNS*] [-f format] [-D X:Y]'; if ($0 ne 'lf') { print "usage: $0 $opts [-F regexp] [file...]\n"; } @@ -566,6 +572,7 @@ options: -l long list -z squeeze size field (slows down output) -L derefernce symbolic links -R recursive into subdirs + -x do not cross filesystem boundaries with -R -F find files matching case insensitive regexp -N show only normal (regular) files -S print statistics summary at end