]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Fix instance list at shell completions
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 11 Dec 2013 00:32:59 +0000 (22:32 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 11 Dec 2013 00:32:59 +0000 (22:32 -0200)
lib/keyringer/completions/bash/keyringer
lib/keyringer/completions/zsh/_keyringer

index 5474c67097f373e95e450c3edffbe3ba829fc7ee..eb8fabde3bdc457706e2b09b97bedd76d64d1267 100644 (file)
@@ -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]}"
index 0eba0792f4f6d89b6d5d9f51aae220ec11ea42d7..e889fd83d26785613179d32adcd373aa46d1b8a9 100644 (file)
@@ -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' \