From b5c6d052c6c84f2673ddcbf487e0051aeb76f621 Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Sat, 28 Sep 2013 00:31:56 +0200 Subject: [PATCH] createindex show file count --- toys/createindex | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/toys/createindex b/toys/createindex index d752ec3..eb1f0b6 100755 --- a/toys/createindex +++ b/toys/createindex @@ -64,6 +64,7 @@ do '-B') show+=(depths) ;; '-t') show+=(titles) ;; '-y') show+=(years) ;; + '-#') show+=(count) ;; '-T') timeformat="$OPTARG" ;; '-o') output="$1" @@ -80,6 +81,7 @@ done cat <<-EOHelp No output specified! -f Path + -# File count -b Average bitrate -C Channels -s Sample rate @@ -144,6 +146,9 @@ printline() { 'oldtimestamp') info=$(printDate ${!info}) ;; + 'count') + info=$(printf %${locallength}d $count) + ;; 'path') while [[ $path =~ / ]] do @@ -317,7 +322,8 @@ do esac if [[ $dir == $olddir ]] then - (( $bitrate )) && (( count++ , bitrates+=bitrate )) + (( count++ )) + (( $bitrate )) && (( bitrates+=bitrate )) (( oldtimestamp = ( timestamp > oldtimestamp @@ -446,7 +452,8 @@ do performers="$performer" titles="$title" years="$year" - (( bitrate )) && (( count=1 , bitrates=bitrate )) + count=1 + (( bitrate )) && (( bitrates=bitrate )) oldmimetype=$mimetype oldrate=$rate oldtimestamp=$timestamp