aboutsummaryrefslogtreecommitdiff
path: root/completion
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-08-16 18:36:52 +0200
committerMattias Andrée <maandree@operamail.com>2012-08-16 18:36:52 +0200
commit8f2cb1bb30f94c48d6176e8b9d07b4e5228331ad (patch)
tree1f4756cb13bf0374ba1e3dddf0f6808cc85bfd1d /completion
parent23d84d1b553d4e820b5a3ce0d388247ee670e20c (diff)
downloadponysay-8f2cb1bb30f94c48d6176e8b9d07b4e5228331ad.tar.gz
ponysay-8f2cb1bb30f94c48d6176e8b9d07b4e5228331ad.tar.bz2
ponysay-8f2cb1bb30f94c48d6176e8b9d07b4e5228331ad.zip
shell completion improvements
Diffstat (limited to 'completion')
-rw-r--r--completion/bash-completion.sh9
-rw-r--r--completion/fish-completion.fish4
-rw-r--r--completion/zsh-completion.zsh2
3 files changed, 7 insertions, 8 deletions
diff --git a/completion/bash-completion.sh b/completion/bash-completion.sh
index 92b1ef6..472bcb0 100644
--- a/completion/bash-completion.sh
+++ b/completion/bash-completion.sh
@@ -5,12 +5,7 @@ _ponysay()
local cur prev words cword
_init_completion -n = || return
- quotes=$(/usr/lib/ponysay/pq4ps --list 2>/dev/null)
- quotesexit=$?
- options='-v -h -l -f -W'
- if [[ $quotesexit = 0 ]]; then
- options="$options -q"
- fi
+ options='-v -h -l -f -W -q'
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
if [[ $prev = "-f" ]]; then
@@ -32,7 +27,7 @@ _ponysay()
elif [[ $prev = "-W" ]]; then
cols=$(( `stty size | cut -d ' ' -f 2` - 10 ))
COMPREPLY=( $cols $(( $cols / 2 )) 100 60 )
- elif [[ $quotesexit = 0 ]] && [[ $prev = "-q" ]]; then
+ elif [[ $prev = "-q" ]]; then
COMPREPLY=( $( compgen -W "$quotes" -- "$cur" ) )
fi
}
diff --git a/completion/fish-completion.fish b/completion/fish-completion.fish
index 802cbf2..1339cf6 100644
--- a/completion/fish-completion.fish
+++ b/completion/fish-completion.fish
@@ -24,7 +24,9 @@ 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 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"
complete -c ponysay -s W -a "Integer" --description "The screen column where the message should be wrapped"
diff --git a/completion/zsh-completion.zsh b/completion/zsh-completion.zsh
index 07b2ebf..5222d38 100644
--- a/completion/zsh-completion.zsh
+++ b/completion/zsh-completion.zsh
@@ -3,7 +3,9 @@ _shortopts=(
'-v[Show version and exit]'
'-h[Show this help and exit]'
'-l[list ponyfiles]'
+ '-L[list ponyfiles with alternatives]'
'-f[Select a pony (either a filename or a ponyname]: :_path_files -W "/usr/share/ponysay/ponies" -g "*(\:r)"'
+ '-q[Select ponies for MLP:FiM quotes]'
'-W[The screen column where the message should be wrapped]'
)
_arguments -s : \