aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-07-18 14:55:35 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-07-18 14:55:35 -0300
commit63a75e777b08d8001234055a016f4782b42a3067 (patch)
tree26723986ff2bfa2a49095bb674f207c57de309db
parentd92f6ba94a7012e42b71b675f146efc14a86482a (diff)
downloadkeyringer-63a75e777b08d8001234055a016f4782b42a3067.tar.gz
keyringer-63a75e777b08d8001234055a016f4782b42a3067.tar.bz2
Appending sub folders on completion
-rw-r--r--lib/keyringer/completions/bash12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/keyringer/completions/bash b/lib/keyringer/completions/bash
index dd8b8e9..5b2f71d 100644
--- a/lib/keyringer/completions/bash
+++ b/lib/keyringer/completions/bash
@@ -39,7 +39,17 @@ _keyringer() {
if [ -z "${cur}" ]; then
opts="`keyringer $instance ls -p`"
else
- opts="`keyringer $instance ls -p -d ${cur}*`"
+ local append
+ opts="`keyringer $instance ls -p -d ${cur}* 2> /dev/null`"
+
+ # Append the contents of each folder, one level down
+ for opt in $opts; do
+ if echo $opt | grep -qe '/$'; then
+ append="$append `keyringer $instance ls -d $opt* 2> /dev/null`"
+ fi
+ done
+
+ #opts="$opts $append"
fi
;;
*)