aboutsummaryrefslogtreecommitdiff
path: root/bash/bash_completion.d/make.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-12-01 02:29:42 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-12-01 02:29:42 +1300
commit0681de59778f82c9006de70ed9a9ee6644fd4a18 (patch)
tree1bba07ac51710494c17920f553dea26a69df55d0 /bash/bash_completion.d/make.bash
parentRemove unneeded quoting in case statement (diff)
downloaddotfiles-0681de59778f82c9006de70ed9a9ee6644fd4a18.tar.gz
dotfiles-0681de59778f82c9006de70ed9a9ee6644fd4a18.zip
Adjust loop short circuits and pattern matches
Diffstat (limited to 'bash/bash_completion.d/make.bash')
-rw-r--r--bash/bash_completion.d/make.bash7
1 files changed, 4 insertions, 3 deletions
diff --git a/bash/bash_completion.d/make.bash b/bash/bash_completion.d/make.bash
index c36a039a..0f39ef4b 100644
--- a/bash/bash_completion.d/make.bash
+++ b/bash/bash_completion.d/make.bash
@@ -5,9 +5,10 @@ _make() {
# first, then "Makefile"). You may want to add "GNU-makefile" after this.
local mf
for mf in makefile Makefile '' ; do
- [[ -f $mf ]] && break
+ [[ -e $mf ]] || continue
+ break
done
- [[ -n $mf ]] || return 1
+ [[ -n $mf ]] || return
# Iterate through the Makefile, line by line
local line
@@ -39,7 +40,7 @@ _make() {
*[^[:word:]./-]*) ;;
# Add targets that match what we're completing
- ${COMP_WORDS[COMP_CWORD]}*)
+ "${COMP_WORDS[COMP_CWORD]}"*)
COMPREPLY[${#COMPREPLY[@]}]=$target
;;
esac