summaryrefslogtreecommitdiff
path: root/contrib/pass.bash-completion
diff options
context:
space:
mode:
authorBrian Mattern <rephorm@rephorm.com>2012-09-22 08:39:53 -0700
committerBrian Mattern <rephorm@rephorm.com>2012-09-22 08:39:53 -0700
commit206e28caa3737f87e8efb1be38294d3279cbed77 (patch)
tree4e639ff0a69982e39629bec4027cc534431dea35 /contrib/pass.bash-completion
parente1c0022255508dcb1ec3dd6dd25e1288d927d384 (diff)
downloadpass-206e28caa3737f87e8efb1be38294d3279cbed77.tar.gz
pass-206e28caa3737f87e8efb1be38294d3279cbed77.tar.bz2
pass-206e28caa3737f87e8efb1be38294d3279cbed77.zip
turn -o filenames back on
only auto-expand if there is a single completion match
Diffstat (limited to '')
-rw-r--r--contrib/pass.bash-completion16
1 files changed, 6 insertions, 10 deletions
diff --git a/contrib/pass.bash-completion b/contrib/pass.bash-completion
index 71bb12a..a7d0f28 100644
--- a/contrib/pass.bash-completion
+++ b/contrib/pass.bash-completion
@@ -10,15 +10,16 @@ _pass_complete_entries () {
autoexpand=${1:-0}
local IFS=$'\n'
- for item in $(compgen -f $prefix$cur); do
+ local items=($(compgen -f $prefix$cur))
+ for item in ${items[@]}; do
if [[ $item == $prefix.* ]]; then
continue
fi
- # append / to directories and recursively expand single-entry dirs
+ # append / to directories and recursively expand single-entry dir
while [[ -d $item ]]; do
item="$item/"
- if [[ $autoexpand -eq 1 ]]; then
- subitems=($(compgen -f $item))
+ if [[ ${#items[@]} -eq 1 && $autoexpand -eq 1 ]]; then
+ local subitems=($(compgen -f $item))
if [[ ${#subitems[@]} -eq 1 ]]; then
item="${subitems[0]}"
else
@@ -29,11 +30,6 @@ _pass_complete_entries () {
fi
done
item="${item%$suffix}"
- item="${item// /\ }"
- item="${item//'/\'}"
- item="${item//\(/\(}"
- item="${item//)/\)}"
- item="${item//&/\&}"
COMPREPLY+=("${item#$prefix}")
done
}
@@ -79,4 +75,4 @@ _pass()
fi
}
-complete -o nospace -F _pass pass
+complete -o filenames -o nospace -F _pass pass
for single commitLars Hjemli1-51/+15 2007-05-13Add shared diff-handling functionsLars Hjemli2-2/+50 2007-05-12css: fix bad rendering in Internet ExplorerLars Hjemli1-2/+7 2007-05-11Add links to enable downloading of tagged blobsLars Hjemli2-9/+85 2007-05-11Makefile: add support for building w.o. preinstalled gitLars Hjemli1-1/+13 2007-05-11Tag release v0.3v0.3Lars Hjemli1-1/+1 2007-05-11Update README with submodule build infoLars Hjemli1-13/+39 2007-05-11Add submodule links in tree listingLars Hjemli6-12/+27 2007-05-11Add submodules.sh and use it during buildsLars Hjemli3-13/+222 2007-05-11Added git as a submoduleLars Hjemli2-1/+1 2007-05-09Add support for downloading single blobsLars Hjemli5-3/+47 2007-05-08ui-view: show pathname if specified in querystringLars Hjemli3-5/+10 2007-05-08Update to libgit 1.5.2-rc2Lars Hjemli9-837/+50 2007-02-21Layout updateLars Hjemli9-32/+127 2007-02-08Make snapshot feature configurableLars Hjemli5-6/+22 2007-02-08Add support for snapshotsLars Hjemli8-8/+153 2007-02-05cgit v0.2v0.2Lars Hjemli1-1/+1 2007-02-05Add support for prefix and gitsrc arguments to 'make'Lars Hjemli2-15/+37 2007-02-04Update cgitrc templateLars Hjemli1-21/+32 2007-02-04Add support for lightweight tagsLars Hjemli2-19/+37 2007-02-04Read repo-info from /etc/cgitrcLars Hjemli5-55/+120 2007-02-04Do not die if tag has no messageLars Hjemli1-2/+2 2007-02-03Fix search for non-virtual urlsLars Hjemli1-0/+6 2007-01-28Update README with install/config informationLars Hjemli1-24/+28