X-Git-Url: http://git.shiar.nl/barcat.git/blobdiff_plain/3de553c8b0f2b2f8776c94ac0bc31231ad2402d3..bad38f691ec8cebb02f3d63292f28dd9d9f21cb9:/barcat diff --git a/barcat b/barcat index 5181143..3744590 100755 --- a/barcat +++ b/barcat @@ -20,7 +20,9 @@ GetOptions(\%opt, eval { local $_ = $_[1]; s/\A[0-9]+\z/(?:\\S*\\h+){$_}\\K/; - s/\A[+]([0-9]*)\z/(?:\\d+\\D+\\b){$1}\\K \\s* (?=\\d)/; + s{\A[+]([0-9]*)\z}{ + (!!$1 && '(?:\d+\D+\b){'.$1.'}\K') . '\s* (?=\d)' + }e; $opt{anchor} = qr/$_/; } or die $@ =~ s/(?:\ at\ \N+)?\Z/ for option $_[0]/r; }, @@ -605,7 +607,17 @@ Compare file sizes (with human-readable numbers): Same from formatted results, selecting the first numeric value: - tree -s --noreport | barcat -H -f+0 + tree -s --noreport | barcat -H -f+ + +Compare media metadata, like image size or play time: + + exiftool -T -p '$megapixels ($imagesize) $filename' * | barcat + + exiftool -T -p '$duration# $avgbitrate# $filename' * | barcat -H + + find -type f -print0 | xargs -0 -L1 \ + ffprobe -show_format -of json -v error | + jq -r '[.format|.duration,.bit_rate,.filename]|join(" ")' | barcat -H Memory usage of user processes with long names truncated: