showpkgs (369B)
1 #!/bin/sh 2 cols='' 3 if [ -n "$*" ]; then 4 cols="-c $*" 5 fi 6 total=$(wc -l lib/pkgs.tsv | cut -d ' ' -f1) 7 total=$((total-1)) 8 git=$(grep '^git' lib/pkgs.tsv | wc -l | cut -d ' ' -f1) 9 tarballs=$((total-git)) 10 { printf "%d total packages (%d git repos, %d tarballs)\n" \ 11 "${total}" "${git}" "${tarballs}" 12 table -d "$(printf '\t')" ${cols} lib/pkgs.tsv -f 35:10:12; } | less -S