summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-12-10 22:32:59 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-12-10 22:32:59 -0200
commit7aac0eea6ab0690e040ffe2ed2eab4adde8d5ead (patch)
tree5775b9195924b719f9583363bf384ace9b4bce84 /lib
parent96b8790728b2eec66f99c2e64d8a332abca41f6f (diff)
downloadkeyringer-7aac0eea6ab0690e040ffe2ed2eab4adde8d5ead.tar.gz
keyringer-7aac0eea6ab0690e040ffe2ed2eab4adde8d5ead.tar.bz2
Fix instance list at shell completions
Diffstat (limited to 'lib')
-rw-r--r--lib/keyringer/completions/bash/keyringer4
-rw-r--r--lib/keyringer/completions/zsh/_keyringer4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/keyringer/completions/bash/keyringer b/lib/keyringer/completions/bash/keyringer
index 5474c67..eb8fabd 100644
--- a/lib/keyringer/completions/bash/keyringer
+++ b/lib/keyringer/completions/bash/keyringer
@@ -70,10 +70,10 @@ _keyringer() {
# Process config
source $config/config
- keyrings="`ls --color=never $config | sed -e 's/config//' | xargs`"
+ keyrings="`ls --color=never $config | sed -e '/^config$/d' | xargs`"
# Available instances
- instances="`echo $keyrings | sed -e 's/ /\\\|/g'`"
+ instances="`echo $keyrings | sed -e 's/ /$\\\|^/g' -e 's/^/^/' -e 's/$/$/'`"
# The current instance
instance="${COMP_WORDS[1]}"
diff --git a/lib/keyringer/completions/zsh/_keyringer b/lib/keyringer/completions/zsh/_keyringer
index 0eba079..e889fd8 100644
--- a/lib/keyringer/completions/zsh/_keyringer
+++ b/lib/keyringer/completions/zsh/_keyringer
@@ -20,9 +20,9 @@ _keyringer() {
# Process config
source $config/config
- local keyrings="`ls --color=never $config | sed -e 's/config//' | xargs`"
+ local keyrings="`ls --color=never $config | sed -e '/^config$/d' | xargs`"
local keyring_path="`eval echo '$'$words[2]`"
- local instances="`echo $keyrings | sed -e 's/ /\\\|/g'`"
+ local instances="`echo $keyrings | sed -e 's/ /$\\\|^/g' -e 's/^/^/' -e 's/$/$/'`"
_arguments \
'1: :->keyring' \