aboutsummaryrefslogtreecommitdiff
path: root/completion/fish-completion.fish
blob: 802cbf27fb6f5d0e8aeec8d25a0e427ddc528b13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Completions for ponysay
# https://github.com/erkin/ponysay/
#
# Author: Elis Axelsson <etu AT elis DOT nu>

if test $TERM = "linux"
	set -g systempath /usr/share/ponysay/ttyponies/
	set -g homepath   ~/.local/share/ponysay/ttyponies/
else
	set -g systempath /usr/share/ponysay/ponies/
	set -g homepath   ~/.local/share/ponysay/ponies/
end


if test -d $systempath
	set -g systemponies (ls --color=no $systempath | sed -e 's/\.pony//' -e 's/_.*//' | perl -pe 's/([a-z])([A-Z])/\1\\\ \2/' )
end

if test -d $homepath
	set -g homeponies   (ls --color=no $homepath   | sed -e 's/\.pony//' -e 's/_.*//' | perl -pe 's/([a-z])([A-Z])/\1\\\ \2/' )
end


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"
complete -c ponysay -s f -a "$homeponies $systemponies" --description "Ponyfile"
complete -c ponysay -s W -a "Integer" --description "The screen column where the message should be wrapped"


set -e systempath
set -e homepath
set -e systemponies
set -e homeponies