From: Sergey Matveev Date: Tue, 15 Mar 2022 17:54:36 +0000 (+0300) Subject: Sizes in indices X-Git-Url: http://www.git.stargrave.org/?p=zk.zsh.git;a=commitdiff_plain;h=da958b56acfc4d53623bf767fd4de309aece238d Sizes in indices --- diff --git a/zk.zsh b/zk.zsh index 9f9c716..7d5f556 100755 --- a/zk.zsh +++ b/zk.zsh @@ -22,9 +22,12 @@ EOF setopt GLOB_STAR_SHORT zmodload -F zsh/stat b:zstat typeset -A pages +typeset -A sizes for p (**(.)) { - zstat -A reply -F "%F %T" +mtime $p - pages[$p]=${reply[1]} + zstat -A mtime -F "%F %T" +mtime $p + zstat -A size +size $p + pages[$p]=${mtime[1]} + sizes[$p]=${size[1]} } typeset -a cats for p (**(/)) cats=($p $cats) @@ -126,7 +129,8 @@ genIndex() { (*) continue ;; esac } - for p (${(oi)_links}) entries=($entries "[$p] (${pages[$p]})") + for p (${(oi)_links}) \ + entries=($entries "[$p] (${pages[$p]}) (${sizes[$p]} bytes)") if [[ $cats ]]; then entries=($entries "\nSubdirectories:\n") for p (${(oi)cats}) {