pfetch: fix bugs

This commit is contained in:
Dylan Araps 2019-11-03 00:45:53 +00:00
parent c9b4d26084
commit a1bbe9749c
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E

4
pfetch
View File

@ -1334,7 +1334,7 @@ main() {
set -f set -f
set +f ${PF_INFO-ascii title os host kernel uptime pkgs memory} set +f ${PF_INFO-ascii title os host kernel uptime pkgs memory}
case $* in *ascii*) get_ascii; shift; esac case $@ in *ascii*) get_ascii; shift; esac
# Iterate over the info functions to determine the lengths of the # Iterate over the info functions to determine the lengths of the
# "info names" for output alignment. The option names and subtitles # "info names" for output alignment. The option names and subtitles
@ -1351,7 +1351,7 @@ main() {
# Add an additional space of length to act as a gap. # Add an additional space of length to act as a gap.
info_length=$((info_length + 1)) info_length=$((info_length + 1))
while IFS= read -r line; do while IFS= read -r line || [ "$1" ]; do
"get_$1" "get_$1"
shift "$(($# ? 1 : 0))" shift "$(($# ? 1 : 0))"
printf '%*.s%s\r%s\n' "$ascii_width" "" "$out" "$line" >&6 printf '%*.s%s\r%s\n' "$ascii_width" "" "$out" "$line" >&6