]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Enhanced secret finder at keyringer_get_file
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 23 Feb 2014 14:35:41 +0000 (11:35 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 23 Feb 2014 14:35:41 +0000 (11:35 -0300)
ChangeLog
lib/keyringer/functions

index 6304d563bbb8b01d31744fd6b790df1459e29d37..d5c74cf134db0c499e4351e0f5b43460c1432bd9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2014-02-23 - Silvio Rhatto  <rhatto@riseup.net>
 
+       Enhanced secret finder at keyringer_get_file
+
        Added find action into shell completions
 
        Using XA_PRIMARY selection at xclip action
index 014c2c9e7f8a0e18af98b4023cf0c9773d85baba..475514de3bdf3427f54f8d67f1c16d62941753d4 100755 (executable)
@@ -413,11 +413,10 @@ function keyringer_get_file {
   elif [ ! -f "$KEYDIR/$FILE" ]; then
     # Try to find a similar file
     count=0
-    candidates=(`keyringer_exec find "$BASEDIR" "$1" | grep -e '.asc$'`)
+    candidates=(`keyringer_exec find "$BASEDIR" | grep -i "$1" | grep -e '.asc$'`)
 
     if [ ! -z "$candidates" ]; then
-      echo "Could not find exact match \"$1\", please chose one"
-      echo "of the following secrets:"
+      echo "Could not find exact match \"$1\", please chose one of the following secrets:"
       echo ""
 
       for candidate in ${candidates[@]}; do
@@ -426,7 +425,7 @@ function keyringer_get_file {
       done
 
       echo ""
-      read -p "Enter option: " option
+      read -p "Enter option (Ctrl-C to abort): " option
 
       if [[ "$option" =~ ^[0-9]+$ ]] && [ ! -z "${candidates[$option]}" ]; then
         FILE="$(keyringer_filename "$RELATIVE_PATH/${candidates[$option]}")"