diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-12-01 02:29:42 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-12-01 02:29:42 +1300 |
commit | 0681de59778f82c9006de70ed9a9ee6644fd4a18 (patch) | |
tree | 1bba07ac51710494c17920f553dea26a69df55d0 /bash/bash_completion.d/bd.bash | |
parent | Remove unneeded quoting in case statement (diff) | |
download | dotfiles-0681de59778f82c9006de70ed9a9ee6644fd4a18.tar.gz dotfiles-0681de59778f82c9006de70ed9a9ee6644fd4a18.zip |
Adjust loop short circuits and pattern matches
Diffstat (limited to 'bash/bash_completion.d/bd.bash')
-rw-r--r-- | bash/bash_completion.d/bd.bash | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bash/bash_completion.d/bd.bash b/bash/bash_completion.d/bd.bash index 1c1a40a8..120080c3 100644 --- a/bash/bash_completion.d/bd.bash +++ b/bash/bash_completion.d/bd.bash @@ -15,8 +15,11 @@ _bd() { # Add the matching dirnames to the reply local dirname for dirname in "${dirnames[@]}" ; do - [[ $dirname == "${COMP_WORDS[COMP_CWORD]}"* ]] || continue - COMPREPLY[${#COMPREPLY[@]}]=$(printf %q "$dirname") + case $dirname in + "${COMP_WORDS[COMP_CWORD]}"*) + COMPREPLY[${#COMPREPLY[@]}]=$(printf %q "$dirname") + ;; + esac done } complete -F _bd bd |