diff options
author | Mattias Andrée <maandree@operamail.com> | 2012-08-18 03:54:39 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2012-08-18 03:54:39 +0200 |
commit | a809144674bb95a737ab3d2010f71716dc33baa8 (patch) | |
tree | bedf4bb5ea5945211e56eab7d52a911d01c5bede /completion | |
parent | 36fbe6da82444f315e87f09f55930fe6a2fb93a6 (diff) | |
parent | e868a2340093ec8fd3c77466b097ddbaf040875a (diff) | |
download | ponysay-a809144674bb95a737ab3d2010f71716dc33baa8.tar.gz ponysay-a809144674bb95a737ab3d2010f71716dc33baa8.tar.bz2 ponysay-a809144674bb95a737ab3d2010f71716dc33baa8.zip |
Merge branch 'develop'
Diffstat (limited to 'completion')
-rw-r--r-- | completion/bash-completion.sh | 21 | ||||
-rw-r--r-- | completion/fish-completion.fish | 10 |
2 files changed, 20 insertions, 11 deletions
diff --git a/completion/bash-completion.sh b/completion/bash-completion.sh index 472bcb0..26e1134 100644 --- a/completion/bash-completion.sh +++ b/completion/bash-completion.sh @@ -8,7 +8,7 @@ _ponysay() options='-v -h -l -f -W -q' COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) - if [[ $prev = "-f" ]]; then + if [ $prev = "-f" ]; then COMPREPLY=() sysponies=/usr/share/ponysay/ponies/ @@ -18,17 +18,18 @@ _ponysay() usrponies=~/.local/share/ponysay/ttyponies/ fi - if [[ -d $sysponies ]]; then - COMPREPLY+=( $( compgen -W "$(ls --color=no $sysponies | sed -e 's/.pony//g')" -- "$cur" ) ) - fi - if [[ -d $usrponies ]]; then - COMPREPLY+=( $( compgen -W "$(ls --color=no $usrponies | sed -e 's/.pony//g')" -- "$cur" ) ) - fi - elif [[ $prev = "-W" ]]; then + [ -d $sysponies ] && COMPREPLY+=( $( compgen -W "$(ls --color=no $sysponies | sed -e 's/.pony//g')" -- "$cur" ) ) + [ -d $usrponies ] && COMPREPLY+=( $( compgen -W "$(ls --color=no $usrponies | sed -e 's/.pony//g')" -- "$cur" ) ) + + elif [ $prev = "-W" ]; then cols=$(( `stty size | cut -d ' ' -f 2` - 10 )) COMPREPLY=( $cols $(( $cols / 2 )) 100 60 ) - elif [[ $prev = "-q" ]]; then - COMPREPLY=( $( compgen -W "$quotes" -- "$cur" ) ) + + elif [ $prev = "-q" ]; then + qcmd=/usr/lib/ponysay/pq4ps + quoters=$($qcmd -l) + COMPREPLY=( $( compgen -W "$quoters" -- "$cur" ) ) + fi } diff --git a/completion/fish-completion.fish b/completion/fish-completion.fish index 1339cf6..89f7a19 100644 --- a/completion/fish-completion.fish +++ b/completion/fish-completion.fish @@ -21,17 +21,25 @@ if test -d $homepath end +set -g qcmd /usr/lib/ponysay/pq4ps +set -g quoters ($qcmd -l) + + 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 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 q -a "$quoters" --description "Select ponies for MLP:FiM quotes" 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 +set -e qcmd +set -e quoters + |