The online documentation has been generated with doxygen, with the help of the bash-doxygen
filter.
Source Tarballs
Name
Size
Online doc
EOF
printf '
%s
\n
\n' "${checksums:l}"
get_size() {
local file=$1
local int round size=$(stat --printf %s "$file")
if [[ $size -gt 1024 ]]
then
int=$((size/1024))
round=$(((size-int*1024)*10/1024))
size="$int.${round} KiB"
fi
printf %s "$size"
}
link() {
local file=$1
printf '%s' "$file" "$file"
}
_tr() {
printf '%s
' "$1"
shift
printf '
%s
' "$@"
printf '
\n'
}
while read sum file
do
[[ -f "$file" ]] || continue
size=$(get_size "$file")
version=${file%.tar.gz}
version=${version#bash-argsparse-}
doxygen="doxygen/$version"
if [[ -d $doxygen ]]
then
doc=$(link "$doxygen")
else
doc=none
fi
_tr ' ' n "$(link "$file")" s "$size" s "$doc" t "$sum"
done < <(sort -V -k2,2 -r "$checksums")
cat <
EOF
printf '
Raw %s file
\n' "$(link "$checksums")"
cat <Source Packages
For reference purpose, here are some packages. The bash argsparse
source tree contains a debian directory and an
RPM spec file.
Name
Size
Arch
Format
EOF
setopt NULL_GLOB
for package in *.spec *.rpm *.deb
do
case "$package" in
*.spec)
format="RPM Spec file"
arch=none
;;
*.rpm)
format=RPM
arch=${package%.rpm}
arch=${arch##*.}
case "$arch" in
noarch) arch=Independent ;;
src) arch=Source ;;
esac
;;
*.deb)
format=Debian
arch=${package%.deb}
arch=${arch##*_}
case "$arch" in
all) arch=Independent ;;
esac
;;
*)
format=Unknown
arch=-
;;
esac
_tr ' ' n "$(link "$package")" s "$(get_size "$package")" d "$arch" d "$format"
done
cat <
Fedora users can install bash-argsparse with yum or dnf.
EOF
printf ' Generated in %s second%s by a homemade CGI script written in %s.' \
"$SECONDS" "$([[ $SECONDS -ge 2 ]] && printf s)" "${0##*/}" "$ZSH_NAME"
cat <
EOF