aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/contrib
diff options
context:
space:
mode:
authorJeffrey Ratcliffe <Jeffrey.Ratcliffe@gmail.com>2012-09-19 07:29:24 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2012-09-20 20:47:45 +0200
commit74e4ea941bb61d9e830ae9d2a7cfe690c2df34f0 (patch)
tree4bccc129f460748d7ffeb7b7081ba4e9de4528e2 /contrib
parentQuit if pwgen returns nothing. (diff)
downloadpassword-store-74e4ea941bb61d9e830ae9d2a7cfe690c2df34f0.tar.xz
password-store-74e4ea941bb61d9e830ae9d2a7cfe690c2df34f0.zip
Fixed bash completion for files with spaces
Diffstat (limited to 'contrib')
-rw-r--r--contrib/pass.bash-completion9
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/pass.bash-completion b/contrib/pass.bash-completion
index 8ddc377..85a2da8 100644
--- a/contrib/pass.bash-completion
+++ b/contrib/pass.bash-completion
@@ -5,7 +5,7 @@
_pass()
{
- local cur prev prefix suffix gen
+ local cur prev prefix suffix
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
@@ -16,6 +16,8 @@ _pass()
return 0
fi
+ local IFS=$'\n'
+ local i=0
for item in $(compgen -f $prefix$cur); do
if [[ $item == $prefix.* ]]; then
continue
@@ -24,9 +26,8 @@ _pass()
item="$item/"
fi
item="${item%$suffix}"
- gen="$gen ${item#$prefix}"
+ COMPREPLY[$i]="${item#$prefix}"
+ (( i++ ))
done
-
- COMPREPLY=( $gen )
}
complete -o filenames -o nospace -F _pass pass