diff options
author | Jeffrey Ratcliffe <Jeffrey.Ratcliffe@gmail.com> | 2012-09-19 07:29:24 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2012-09-20 20:47:45 +0200 |
commit | 74e4ea941bb61d9e830ae9d2a7cfe690c2df34f0 (patch) | |
tree | 4bccc129f460748d7ffeb7b7081ba4e9de4528e2 | |
parent | 5bc781bd38ea4141e5e3b9110bf28214773cf1a3 (diff) |
Fixed bash completion for files with spaces
-rw-r--r-- | contrib/pass.bash-completion | 9 |
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 |