2012-07-20 18:51:30 +02:00
|
|
|
# Completions for ponysay
|
2012-07-19 14:56:43 +02:00
|
|
|
# https://github.com/erkin/ponysay/
|
|
|
|
#
|
|
|
|
# Author: Elis Axelsson <etu AT elis DOT nu>
|
|
|
|
|
2012-07-19 21:28:35 +02:00
|
|
|
if test $TERM = "linux"
|
2012-07-20 19:13:15 +02:00
|
|
|
set -g systempath /usr/share/ponysay/ttyponies/
|
|
|
|
set -g homepath ~/.local/share/ponysay/ttyponies/
|
2012-07-19 21:28:35 +02:00
|
|
|
else
|
2012-07-20 19:13:15 +02:00
|
|
|
set -g systempath /usr/share/ponysay/ponies/
|
|
|
|
set -g homepath ~/.local/share/ponysay/ponies/
|
2012-07-19 21:28:35 +02:00
|
|
|
end
|
|
|
|
|
2012-07-19 14:56:43 +02:00
|
|
|
|
2012-07-19 21:28:35 +02:00
|
|
|
if test -d $systempath
|
2012-07-21 12:34:35 +02:00
|
|
|
set -g systemponies (ls --color=no $systempath | sed -e 's/\.pony//' -e 's/_.*//' | perl -pe 's/([a-z])([A-Z])/\1\\\ \2/' )
|
2012-07-19 14:56:43 +02:00
|
|
|
end
|
|
|
|
|
2012-07-19 21:28:35 +02:00
|
|
|
if test -d $homepath
|
2012-07-21 17:39:11 +02:00
|
|
|
set -g homeponies (ls --color=no $homepath | sed -e 's/\.pony//' -e 's/_.*//' | perl -pe 's/([a-z])([A-Z])/\1\\\ \2/' )
|
2012-07-19 14:56:43 +02:00
|
|
|
end
|
|
|
|
|
2012-07-19 21:28:35 +02:00
|
|
|
|
2012-07-19 14:56:43 +02:00
|
|
|
complete -c ponysay -s h --description "Help of ponysay"
|
|
|
|
complete -c ponysay -s v --description "Version of ponysay"
|
|
|
|
complete -c ponysay -s l --description "List pony files"
|
2012-08-16 18:36:52 +02:00
|
|
|
complete -c ponysay -s L --description "List pony files with alternatives"
|
|
|
|
complete -c ponysay -s f -a "$homeponies $systemponies" --description "Select a pony"
|
|
|
|
complete -c ponysay -s q -a "$homeponies $systemponies" --description "Select ponies for MLP:FiM quotes"
|
2012-07-19 14:56:43 +02:00
|
|
|
complete -c ponysay -s W -a "Integer" --description "The screen column where the message should be wrapped"
|
|
|
|
|
2012-07-19 21:28:35 +02:00
|
|
|
|
|
|
|
set -e systempath
|
|
|
|
set -e homepath
|
2012-07-19 14:56:43 +02:00
|
|
|
set -e systemponies
|
|
|
|
set -e homeponies
|
|
|
|
|