aboutsummaryrefslogtreecommitdiff
path: root/ponysay
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-07-18 19:39:04 +0200
committerMattias Andrée <maandree@operamail.com>2012-07-18 19:39:04 +0200
commitb5868da56c55ff0ce051b328f45470c8b0653ca4 (patch)
treed5f64922ae4f7c085fd878d793609ae24db540c2 /ponysay
parent494dbd1eb5a2ab9ebaa323d34061722fee3986af (diff)
downloadponysay-b5868da56c55ff0ce051b328f45470c8b0653ca4.tar.gz
ponysay-b5868da56c55ff0ce051b328f45470c8b0653ca4.tar.bz2
ponysay-b5868da56c55ff0ce051b328f45470c8b0653ca4.zip
flewless `ponysay -l`
Diffstat (limited to 'ponysay')
-rwxr-xr-xponysay21
1 files changed, 4 insertions, 17 deletions
diff --git a/ponysay b/ponysay
index a5edea0..0928737 100755
--- a/ponysay
+++ b/ponysay
@@ -20,28 +20,15 @@ version() {
list() {
scrw=`(stty size <&2 || echo 0 0) | cut -d ' ' -f 2`
- (( $scrw > 80 )) && scrw=80
+
+ listcmd=$(echo $0 | sed -e 's/\/ponysay$/\//g' -e 's/\/ponythink$/\//g')"ponysaylist.pl"
echo -e "\\e[01mponyfiles located in $SYSTEMPONIES:\\e[21m"
- files=`ls -1 $SYSTEMPONIES | sed "s/.pony//"`
- maxw=1
- for file in $files; do
- w=$(( `echo $file | wc -m` + 2 ))
- (( $maxw < $w )) && maxw=$w
- done
- cols=$(( $scrw / $maxw ))
- echo "$files" | pr -T --columns=$cols
+ perl $listcmd $scrw $(ls --color=no $SYSTEMPONIES | sed "s/.pony//" | sort)
if [[ -d $HOMEPONIES ]]; then
echo -e "\\e[01mponyfiles located in $HOMEPONIES:\\e[21m"
- files=`ls -1 $HOMEPONIES | sed "s/.pony//"`
- maxw=1
- for file in $files; do
- w=$(( `echo $file | wc -m` ))
- (( $maxw < $w )) && maxw=$w
- done
- cols=$(( $scrw / $maxw ))
- echo "$files" | pr -T --columns=$cols
+ perl $listcmd $scrw $(ls --color=no $HOMEPONIES | sed "s/.pony//" | sort)
fi
}