]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Appending sub folders on completion
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 18 Jul 2013 17:55:35 +0000 (14:55 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 18 Jul 2013 17:55:35 +0000 (14:55 -0300)
lib/keyringer/completions/bash

index dd8b8e9f1a356517560b8be14ee267ed48baf510..5b2f71db7a948e396f71d11e02976e5cb5bb74f4 100644 (file)
@@ -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
         ;;
       *)