aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-09-28 17:09:49 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-09-28 17:09:49 -0300
commit7b281024fdd9fd7bbf461265316360c80c4deee2 (patch)
treea416f7b3f76beffe25dbb9533bd48dfccf7aa8d9 /lib
parenta5aaf69c3865fd89de64c9b9f3cfc17b0d561843 (diff)
downloadkeyringer-7b281024fdd9fd7bbf461265316360c80c4deee2.tar.gz
keyringer-7b281024fdd9fd7bbf461265316360c80c4deee2.tar.bz2
Set KEYRINGER_CHECK_VERSION=false on shell completions
Diffstat (limited to 'lib')
-rw-r--r--lib/keyringer/completions/bash/keyringer6
-rw-r--r--lib/keyringer/completions/zsh/_keyringer6
-rwxr-xr-xlib/keyringer/functions6
3 files changed, 12 insertions, 6 deletions
diff --git a/lib/keyringer/completions/bash/keyringer b/lib/keyringer/completions/bash/keyringer
index 63c917f..ccc1851 100644
--- a/lib/keyringer/completions/bash/keyringer
+++ b/lib/keyringer/completions/bash/keyringer
@@ -73,7 +73,7 @@ _keyringer() {
if [ "${#COMP_WORDS[@]}" == "2" ]; then
opts="$keyrings"
elif [ "${#COMP_WORDS[@]}" == "3" ] && echo "${prev}" | grep -qe "[$instances]"; then
- opts="`keyringer $instance commands`"
+ opts="`export KEYRINGER_CHECK_VERSION=false && keyringer $instance commands`"
elif [ "${#COMP_WORDS[@]}" == "4" ]; then
case "${prev}" in
options|preferences)
@@ -83,7 +83,7 @@ _keyringer() {
opts="ls edit"
;;
ls|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|recrypt|open)
- opts="$(bash -c "set -f && keyringer $instance ls -p -d ${cur}*" 2> /dev/null)"
+ opts="$(bash -c "set -f && export KEYRINGER_CHECK_VERSION=false && keyringer $instance ls -p -d ${cur}*" 2> /dev/null)"
;;
genpair)
opts="gpg ssh ssl ssl-self"
@@ -100,7 +100,7 @@ _keyringer() {
opts="$(cd $path/config/recipients && ls --color=never -p ${cur}* 2> /dev/null)"
;;
genpair)
- opts="$(bash -c "set -f && keyringer $instance ls -p -d ${cur}*" 2> /dev/null)"
+ opts="$(bash -c "set -f && export KEYRINGER_CHECK_VERSION=false && keyringer $instance ls -p -d ${cur}*" 2> /dev/null)"
;;
git)
# TODO
diff --git a/lib/keyringer/completions/zsh/_keyringer b/lib/keyringer/completions/zsh/_keyringer
index 6f26993..0a158eb 100644
--- a/lib/keyringer/completions/zsh/_keyringer
+++ b/lib/keyringer/completions/zsh/_keyringer
@@ -35,7 +35,7 @@ _keyringer() {
_arguments "1:Keyrings:($keyrings)"
;;
action)
- compadd "$@" `keyringer $words[2] commands`
+ compadd "$@" `KEYRINGER_CHECK_VERSION=false keyringer $words[2] commands`
;;
options)
case $words[3] in
@@ -47,7 +47,7 @@ _keyringer() {
;;
ls|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|recrypt|open)
# TODO: do not rely on bash
- compadd "$@" $(bash -c "set -f && keyringer $words[2] ls -p -d $words[4]*" 2> /dev/null)
+ compadd "$@" $(bash -c "set -f && KEYRINGER_CHECK_VERSION=false keyringer $words[2] ls -p -d $words[4]*" 2> /dev/null)
;;
genpair)
compadd "$@" gpg ssh ssl ssl-self
@@ -66,7 +66,7 @@ _keyringer() {
;;
genpair)
# TODO: do not rely on bash
- compadd "$@" $(bash -c "set -f && keyringer $words[2] ls -p -d $words[5]*" 2> /dev/null)
+ compadd "$@" $(bash -c "set -f && KEYRINGER_CHECK_VERSION=false keyringer $words[2] ls -p -d $words[5]*" 2> /dev/null)
;;
git)
# TODO
diff --git a/lib/keyringer/functions b/lib/keyringer/functions
index e2e8fba..1bc6393 100755
--- a/lib/keyringer/functions
+++ b/lib/keyringer/functions
@@ -230,6 +230,12 @@ function keyringer_set_env {
# Configuration version tracking to help keyring upgrades
function keyringer_check_version {
if [ "$KEYRINGER_CHECK_VERSION" == "false" ]; then
+ if [ -f "$VERSION_INFO" ]; then
+ VERSION="`cat $VERSION_INFO`"
+ else
+ VERSION=""
+ fi
+
return
fi