summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-02-23 11:35:41 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-02-23 11:35:41 -0300
commitb160c9b14e035da1dd19df9be1b58c61ceea46ad (patch)
treea91fe01dc63545a2bd26bcfafb4d5cdf4828f59c /lib
parentaa6ce1eafd8a89cea640841f8e0162415859d536 (diff)
downloadkeyringer-b160c9b14e035da1dd19df9be1b58c61ceea46ad.tar.gz
keyringer-b160c9b14e035da1dd19df9be1b58c61ceea46ad.tar.bz2
Enhanced secret finder at keyringer_get_file
Diffstat (limited to 'lib')
-rwxr-xr-xlib/keyringer/functions7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/keyringer/functions b/lib/keyringer/functions
index 014c2c9..475514d 100755
--- a/lib/keyringer/functions
+++ b/lib/keyringer/functions
@@ -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]}")"