]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Shell completions: fix handling of keyrings with '-' in their names
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 21 Aug 2014 18:37:06 +0000 (15:37 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 21 Aug 2014 18:37:06 +0000 (15:37 -0300)
ChangeLog
lib/keyringer/completions/bash/keyringer
lib/keyringer/completions/zsh/_keyringer

index e9be9aac5848e398b010c5118d7a9bb89e27e54c..0905d9fe751eafd9459a174ef32382a24a3422f9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,6 @@
-2014-08-16 - Silvio Rhatto <rhatto@riseup.net>
+2014-08-21 - Silvio Rhatto <rhatto@riseup.net>
+
+       Shell completions: fix handling of keyrings with '-' in their names
 
        Edit: Unset RELATIVE_PATH before encrypting file
 
index 0f2cb2bbcbf714e108c15d9e66efb9e534d4032d..b638418b6039048800070c6899259ebea9b4247e 100644 (file)
@@ -69,7 +69,6 @@ _keyringer() {
   fi
 
   # Process config
-  source $config/config
   keyrings="`ls --color=never $config | sed -e '/^config$/d' | xargs`"
 
   # Available instances
@@ -77,7 +76,7 @@ _keyringer() {
 
   # The current instance
   instance="${COMP_WORDS[1]}"
-  path="`eval echo '$'$instance`"
+  path="`grep -e "^$instance=" "$config/config" | tail -n 1 | cut -d = -f 2 | sed -e 's/"//g' -e "s/'//g" | sed -e 's/ *#.*$//'`"
 
   # Command completions
   if [ "${#COMP_WORDS[@]}" == "2" ]; then
index b4ccdd40113af6b6e76f460be63e5e81799d9374..6142949e53057f040e1b8ef14771dbf5ac3e8287 100644 (file)
@@ -19,9 +19,8 @@ _keyringer() {
     fi
 
     # Process config
-    source $config/config
     local keyrings="`ls --color=never $config | sed -e '/^config$/d' | xargs`"
-    local keyring_path="`eval echo '$'$words[2]`"
+    local keyring_path="`grep -e "^$words[2]=" "$config/config" | tail -n 1 | cut -d = -f 2 | sed -e 's/"//g' -e "s/'//g" | sed -e 's/ *#.*$//'`"
     local instances="`echo $keyrings | sed -e 's/ /$\\\|^/g' -e 's/^/^/' -e 's/$/$/'`"
 
     _arguments        \