aboutsummaryrefslogtreecommitdiff
path: root/completion
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-07-19 12:35:53 -0700
committerMattias Andrée <maandree@operamail.com>2012-07-19 12:35:53 -0700
commit4c2b7c49e79c9d1f17f560ad6a5149fc67514084 (patch)
tree20dd09e652b9e07679b2162d13ec5821a631bf30 /completion
parent66f94046d32bebf5da47c491898d6dedd262a2e3 (diff)
parentcf204faeebe5fe80a6bceeddc14ec2b6690a9520 (diff)
downloadponysay-4c2b7c49e79c9d1f17f560ad6a5149fc67514084.tar.gz
ponysay-4c2b7c49e79c9d1f17f560ad6a5149fc67514084.tar.bz2
ponysay-4c2b7c49e79c9d1f17f560ad6a5149fc67514084.zip
Merge pull request #40 from etu/master
Improved the fish-completions
Diffstat (limited to 'completion')
-rw-r--r--completion/fish-completion.fish22
1 files changed, 17 insertions, 5 deletions
diff --git a/completion/fish-completion.fish b/completion/fish-completion.fish
index ea98382..8d3c911 100644
--- a/completion/fish-completion.fish
+++ b/completion/fish-completion.fish
@@ -4,21 +4,33 @@
#
# 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 /usr/share/ponysay/ponies/
- set -g systemponies (ls --color=no /usr/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from \/usr\/share\/ponysay\/ponies\//')
+if test -d $systempath
+ set -g systemponies (ls --color=no $systempath | sed 's/\.pony//')
end
-if test -d ~/.local/share/ponysay/ponies/
- set -g homeponies (ls --color=no ~/.local/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from ~\/.local\/share\/ponysay\/ponies\//')
+if test -d $homepath
+ set -g homeponies (ls --color=no $homepath | sed 's/\.pony//')
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 "$systemponies $homeponies" --description "Select a pony, either a filename or pony name"
+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