diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-08-23 10:44:33 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2015-03-24 14:46:46 -0300 |
commit | be12c6d664052258bb15e63d136cc7606971fd7b (patch) | |
tree | f4379c8e29877245a43527cd52c53dd9f03bc41a | |
parent | fdcf1c06a7aa3cf8e901e7d2b802143af87684f0 (diff) | |
download | keyringer-be12c6d664052258bb15e63d136cc7606971fd7b.tar.gz keyringer-be12c6d664052258bb15e63d136cc7606971fd7b.tar.bz2 |
Adding completions for cp and mv actions
-rw-r--r-- | lib/keyringer/completions/bash/keyringer | 6 | ||||
-rw-r--r-- | lib/keyringer/completions/zsh/_keyringer | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/keyringer/completions/bash/keyringer b/lib/keyringer/completions/bash/keyringer index 27cf919..d2083de 100644 --- a/lib/keyringer/completions/bash/keyringer +++ b/lib/keyringer/completions/bash/keyringer @@ -93,7 +93,7 @@ _keyringer() { recipients) opts="ls edit" ;; - ls|tree|mkdir|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open|clip|xclip|find) + ls|tree|mkdir|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open|clip|xclip|find|mv|cp) cur="`echo ${cur} | sed -e "s|^/*||"`" # avoid leading slash opts="$(bash -c "set -f && export KEYRINGER_CHECK_RECIPIENTS=false && export KEYRINGER_CHECK_VERSION=false && keyringer $instance ls -p -d ${cur}*" 2> /dev/null)" ;; @@ -112,6 +112,10 @@ _keyringer() { esac elif [ "${#COMP_WORDS[@]}" == "5" ]; then case "${command}" in + mv|cp) + cur="`echo ${cur} | sed -e "s|^/*||"`" # avoid leading slash + opts="$(bash -c "set -f && export KEYRINGER_CHECK_RECIPIENTS=false && export KEYRINGER_CHECK_VERSION=false && keyringer $instance ls -p -d ${cur}*" 2> /dev/null)" + ;; recipients) cur="`echo ${cur} | sed -e "s|^/*||"`" # avoid leading slash opts="$(cd $path/config/recipients && ls --color=never -p ${cur}* 2> /dev/null)" diff --git a/lib/keyringer/completions/zsh/_keyringer b/lib/keyringer/completions/zsh/_keyringer index ab95c3d..3963b4b 100644 --- a/lib/keyringer/completions/zsh/_keyringer +++ b/lib/keyringer/completions/zsh/_keyringer @@ -49,7 +49,7 @@ _keyringer() { recipients) compadd "$@" ls edit ;; - ls|tree|mkdir|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open|clip|xclip|find) + ls|tree|mkdir|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open|clip|xclip|find|mv|cp) words[4]="`echo $words[4] | sed -e "s|^/*||"`" # avoid leading slash compadd "$@" $(KEYRINGER_CHECK_RECIPIENTS=false KEYRINGER_CHECK_VERSION=false keyringer $words[2] ls -p -d $words[4]'*' 2> /dev/null) ;; @@ -68,6 +68,10 @@ _keyringer() { ;; misc) case "$words[3]" in + mv|cp) + words[5]="`echo $words[5] | sed -e "s|^/*||"`" # avoid leading slash + compadd "$@" $(KEYRINGER_CHECK_RECIPIENTS=false KEYRINGER_CHECK_VERSION=false keyringer $words[2] ls -p -d $words[5]'*' 2> /dev/null) + ;; recipients) words[5]="$(echo $words[5] | sed -e "s|^/||")" # TODO: avoid leading slash compadd "$@" $(cd $keyring_path/config/recipients && ls --color=never -p $words[5]* 2> /dev/null) |