summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/pass.bash-completion21
1 files changed, 12 insertions, 9 deletions
diff --git a/contrib/pass.bash-completion b/contrib/pass.bash-completion
index a7d0f28..72f2abb 100644
--- a/contrib/pass.bash-completion
+++ b/contrib/pass.bash-completion
@@ -15,20 +15,23 @@ _pass_complete_entries () {
if [[ $item == $prefix.* ]]; then
continue
fi
- # append / to directories and recursively expand single-entry dir
- while [[ -d $item ]]; do
- item="$item/"
- if [[ ${#items[@]} -eq 1 && $autoexpand -eq 1 ]]; then
- local subitems=($(compgen -f $item))
+
+ # if there is a unique match, and it is a directory with one entry
+ # autocomplete the subentry as well (recursively)
+ if [[ ${#items[@]} -eq 1 && $autoexpand -eq 1 ]]; then
+ while [[ -d $item ]]; do
+ local subitems=($(compgen -f "$item/"))
if [[ ${#subitems[@]} -eq 1 ]]; then
item="${subitems[0]}"
else
break
fi
- else
- break
- fi
- done
+ done
+ fi
+
+ # append / to directories
+ [[ -d $item ]] && item="$item/"
+
item="${item%$suffix}"
COMPREPLY+=("${item#$prefix}")
done
id=b4a2b04706d0b86bcd9fd47c77a2c579805196a0&follow=1'>Set Poly/ML as the default SML interpreter.René Neumann1-0/+3 2011-11-21Added support for jedit.René Neumann2-4/+11 2011-11-16Make 'hg k' work similar to 'git k'René 'Necoro' Neumann1-0/+3 2011-10-14'tabgroup' -> 'tabgroups'René 'Necoro' Neumann1-1/+1 2011-10-14Switch from openoffice alias to libreoffice (ooffice -> soffice)René 'Necoro' Neumann1-2/+2 2011-10-14Make the quotes in ProofGeneral to be nearly invisibleRené Neumann1-1/+1 2011-08-23Disable hightlighting of the domain in the FF urlbarRené Neumann1-0/+3 2011-08-12Enhance IE scriptRené Neumann1-6/+7 2011-08-11BlaRené 'Necoro' Neumann1-0/+2 2011-08-11Local fontsRené 'Necoro' Neumann1-13/+22 2011-08-11Better inconsolata thingsRené Neumann4-4/+13 2011-08-10Moved some functions to their own filesRené Neumann3-124/+120 2011-08-10More advanced IE scriptRené Neumann2-1/+74 2011-08-10Inconsolata also in emacsRené Neumann1-1/+1 2011-08-10Better vim fontsRené 'Necoro' Neumann1-1/+1 2011-08-09ooffice aliasRené Neumann1-0/+2 2011-08-09Update the needed hg-extensions.René Neumann1-1/+2 2011-06-08gtkrc stuff for Qt-Gtk-StyleRené 'Necoro' Neumann2-0/+8 2011-06-08Updated fonts.conf to work better on lcdsRené 'Necoro' Neumann1-17/+6