Better comma hanfling
This commit is contained in:
parent
ecdc3ff9b4
commit
08e8113c8b
1 changed files with 13 additions and 5 deletions
18
neofetch
18
neofetch
|
@ -597,17 +597,25 @@ getuptime () {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$hours" in
|
case "$hours" in
|
||||||
1) hours="1 hour," ;;
|
1) hours="1 hour" ;;
|
||||||
0) unset hours ;;
|
0) unset hours ;;
|
||||||
*) hours="$hours hours," ;;
|
*) hours="$hours hours" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$days" in
|
case "$days" in
|
||||||
1) days="1 day," ;;
|
1) days="1 day" ;;
|
||||||
0) unset days;;
|
0) unset days ;;
|
||||||
*) days="$days days," ;;
|
*) days="$days days" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
[ ! -z "$hours" ] && \
|
||||||
|
[ ! -z "$minutes" ] && \
|
||||||
|
hours+=","
|
||||||
|
|
||||||
|
[ ! -z "$days" ] && \
|
||||||
|
[ ! -z "$hours" ] && \
|
||||||
|
days+=","
|
||||||
|
|
||||||
uptime="up $days $hours $minutes"
|
uptime="up $days $hours $minutes"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue