aboutsummaryrefslogtreecommitdiff
path: root/ponysay
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-08-18 12:57:41 +0200
committerMattias Andrée <maandree@operamail.com>2012-08-18 12:57:41 +0200
commite01fefb0b9699d6ebed8c0e5bef3cd93c4791fa2 (patch)
tree42dc75dd121193c013aa421ff278a27906fac7a1 /ponysay
parentb008fbbd7d10107b6caaf8cc41905f4704e91925 (diff)
parent34bbd088cabb429f2838ce3fc8e1454a4994f591 (diff)
downloadponysay-e01fefb0b9699d6ebed8c0e5bef3cd93c4791fa2.tar.gz
ponysay-e01fefb0b9699d6ebed8c0e5bef3cd93c4791fa2.tar.bz2
ponysay-e01fefb0b9699d6ebed8c0e5bef3cd93c4791fa2.zip
Merge branch 'develop'
Diffstat (limited to 'ponysay')
-rwxr-xr-xponysay17
1 files changed, 11 insertions, 6 deletions
diff --git a/ponysay b/ponysay
index 0d0beee..9936fae 100755
--- a/ponysay
+++ b/ponysay
@@ -15,8 +15,8 @@ HOMESHARE="${HOME}/.local/share/ponysay"
listcmd="$INSTALLDIR/lib/ponysay/list.pl"
linklistcmd="$INSTALLDIR/lib/ponysay/linklist.pl"
truncatercmd="$INSTALLDIR/lib/ponysay/truncater"
-qlistcmd="$INSTALLDIR/lib/ponysay/pq4ps-list"
quotecmd="$INSTALLDIR/lib/ponysay/pq4ps"
+qlistcmd="$INSTALLDIR/lib/ponysay/pq4ps-list.pl"
pony="*" # Selected pony
wrap="" # Message wrap column
@@ -65,15 +65,20 @@ version() {
echo "ponysay v$VERSION"
}
+# Marks ponies in lists that have quotes
+qoutelist() {
+ bash -c "$("$qlistcmd" $("$quotecmd" --list))"
+}
+
# Pony list function
list() {
if [ -d $SYSTEMPONIES ]; then
echo -e "\\e[01mponyfiles located in $SYSTEMPONIES:\\e[21m"
- perl $listcmd $scrw $(ls --color=no $SYSTEMPONIES | sed -e 's/\.pony$//' | sort) | $qlistcmd
+ perl $listcmd $scrw $(ls --color=no $SYSTEMPONIES | sed -e 's/\.pony$//' | sort) | qoutelist
fi
if [ -d $HOMEPONIES ]; then
echo -e "\\e[01mponyfiles located in $HOMEPONIES:\\e[21m"
- perl $listcmd $scrw $(ls --color=no $HOMEPONIES | sed -e 's/\.pony$//' | sort) | $qlistcmd
+ perl $listcmd $scrw $(ls --color=no $HOMEPONIES | sed -e 's/\.pony$//' | sort) | qoutelist
fi
if [ ! -d $SYSTEMPONIES ] && [ ! -d $HOMEPONIES ]; then
echo >&2 "All the ponies are missing! Call the Princess!"
@@ -88,9 +93,9 @@ _linklist() {
args=""
for file in $files; do
- target=$(readlink $1"/"$file".pony")
+ target="$(readlink $1"/"$file".pony")"
- if [ $target = "" ]; then
+ if [ "$target" = "" ]; then
target=$file
else
target=$(echo $target | sed -e 's/^\.\///g' -e 's/\.pony$//g')
@@ -99,7 +104,7 @@ _linklist() {
args=$(echo $args $file $target)
done
- perl $listcmd $scrw $(perl $linklistcmd $(echo $args) | sed -e 's/ /_/g') | sed -e 's/_/ /g' | $qlistcmd
+ perl $listcmd $scrw $(perl $linklistcmd $(echo $args) | sed -e 's/ /_/g') | sed -e 's/_/ /g' | qoutelist
}
# Pony list function with symlink map, for both directories