m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Mattern <rephorm@rephorm.com>2012-09-21 14:40:43 -0700
committerBrian Mattern <rephorm@rephorm.com>2012-09-21 14:40:43 -0700
commitb947ef162265060fc79933403968f0fa8d37e214 (patch)
tree8875915f0c1d48f281e846bf23544f271ea8a4e8
parentc2d28accf5c79c7929a90506061c70ffa70cca86 (diff)
Append to COMPREPLY instead of inserting by index
-rw-r--r--contrib/pass.bash-completion4
1 files changed, 1 insertions, 3 deletions
diff --git a/contrib/pass.bash-completion b/contrib/pass.bash-completion
index 36c0cf2..bd7ed61 100644
--- a/contrib/pass.bash-completion
+++ b/contrib/pass.bash-completion
@@ -10,7 +10,6 @@ _pass_complete_entries () {
autoexpand=${1:-0}
local IFS=$'\n'
- local i=0
for item in $(compgen -f $prefix$cur); do
if [[ $item == $prefix.* ]]; then
continue
@@ -30,8 +29,7 @@ _pass_complete_entries () {
fi
done
item="${item%$suffix}"
- COMPREPLY[$i]=$(printf "%q" "${item#$prefix}" )
- (( i++ ))
+ COMPREPLY+=($(printf "%q" "${item#$prefix}" ))
done
}