Commit 50c8eac5 authored by Silvio Rhatto's avatar Silvio Rhatto
Browse files

Shell completions: use KEYRINGER_CHECK_RECIPIENTS=false to avoid fatal errors

parent b3c2760b
2014-08-21 - Silvio Rhatto <rhatto@riseup.net>
Shell completions: use KEYRINGER_CHECK_RECIPIENTS=false to avoid
fatal errors
Shell completions: minor zsh fixes
Shell completions: fix handling of keyrings with '-' in their names
and minor zsh fixes.
Edit: Unset RELATIVE_PATH before encrypting file
......
......@@ -82,7 +82,7 @@ _keyringer() {
if [ "${#COMP_WORDS[@]}" == "2" ]; then
opts="$keyrings"
elif [ "${#COMP_WORDS[@]}" == "3" ] && echo "${prev}" | grep -qe "$instances"; then
opts="`export KEYRINGER_CHECK_VERSION=false && keyringer $instance commands`"
opts="`export KEYRINGER_CHECK_RECIPIENTS=false && export KEYRINGER_CHECK_VERSION=false && keyringer $instance commands`"
elif [ "${#COMP_WORDS[@]}" == "3" ]; then
opts="init"
elif [ "${#COMP_WORDS[@]}" == "4" ]; then
......@@ -95,7 +95,7 @@ _keyringer() {
;;
ls|tree|mkdir|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open|clip|xclip|find)
cur="`echo ${cur} | sed -e "s|^/*||"`" # avoid leading slash
opts="$(bash -c "set -f && export KEYRINGER_CHECK_VERSION=false && keyringer $instance ls -p -d ${cur}*" 2> /dev/null)"
opts="$(bash -c "set -f && export KEYRINGER_CHECK_RECIPIENTS=false && export KEYRINGER_CHECK_VERSION=false && keyringer $instance ls -p -d ${cur}*" 2> /dev/null)"
;;
genpair)
opts="gpg ssh ssl ssl-self"
......@@ -118,7 +118,7 @@ _keyringer() {
;;
genpair)
cur="`echo ${cur} | sed -e "s|^/*||"`" # avoid leading slash
opts="$(bash -c "set -f && export KEYRINGER_CHECK_VERSION=false && keyringer $instance ls -p -d ${cur}*" 2> /dev/null)"
opts="$(bash -c "set -f && export KEYRINGER_CHECK_RECIPIENTS=false && export KEYRINGER_CHECK_VERSION=false && keyringer $instance ls -p -d ${cur}*" 2> /dev/null)"
;;
git)
# TODO
......
......@@ -36,7 +36,7 @@ _keyringer() {
;;
action)
if echo $words[2] | grep -qe "$instances"; then
compadd "$@" `KEYRINGER_CHECK_VERSION=false keyringer $words[2] commands`
compadd "$@" `KEYRINGER_CHECK_RECIPIENTS=false KEYRINGER_CHECK_VERSION=false keyringer $words[2] commands`
else
compadd "$@" "init"
fi
......@@ -51,7 +51,7 @@ _keyringer() {
;;
ls|tree|mkdir|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open|clip|xclip|find)
words[4]="`echo $words[4] | sed -e "s|^/*||"`" # avoid leading slash
compadd "$@" $(KEYRINGER_CHECK_VERSION=false keyringer $words[2] ls -p -d $words[4]'*' 2> /dev/null)
compadd "$@" $(KEYRINGER_CHECK_RECIPIENTS=false KEYRINGER_CHECK_VERSION=false keyringer $words[2] ls -p -d $words[4]'*' 2> /dev/null)
;;
genpair)
compadd "$@" gpg ssh ssl ssl-self
......@@ -74,7 +74,7 @@ _keyringer() {
;;
genpair)
words[5]="$(echo $words[5] | sed -e "s|^/||")" # TODO: avoid leading slash
compadd "$@" $(KEYRINGER_CHECK_VERSION=false keyringer $words[2] ls -p -d $words[5]'*' 2> /dev/null)
compadd "$@" $(KEYRINGER_CHECK_RECIPIENTS=false KEYRINGER_CHECK_VERSION=false keyringer $words[2] ls -p -d $words[5]'*' 2> /dev/null)
;;
git)
compadd "$@" $(_keyringer_git_complete $words[4] $words[5])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment