aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-12-07 01:08:03 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-12-07 01:08:03 +1300
commit5fa3ef7020ca96ca5577016c845db6c13caa8eea (patch)
tree32910d8edd45fcca5255b1d460ce0f06620b733c /bash
parentAdd filenames treatment to mex(1df) completion (diff)
downloaddotfiles-5fa3ef7020ca96ca5577016c845db6c13caa8eea.tar.gz
dotfiles-5fa3ef7020ca96ca5577016c845db6c13caa8eea.zip
Disable shellcheck rules for missed definition
These two arrays are both defined by `read -a`.
Diffstat (limited to 'bash')
-rw-r--r--bash/bash_completion.d/make.bash2
-rw-r--r--bash/bash_completion.d/path.bash2
2 files changed, 2 insertions, 2 deletions
diff --git a/bash/bash_completion.d/make.bash b/bash/bash_completion.d/make.bash
index 7f8b8125..909c52fb 100644
--- a/bash/bash_completion.d/make.bash
+++ b/bash/bash_completion.d/make.bash
@@ -34,11 +34,11 @@ _make() {
esac
# Break the target up with space delimiters
- declare -a targets
IFS=' ' read -a targets -r \
< <(printf '%s\n' "${line%%:*}")
# Short-circuit if there are no targets
+ # shellcheck disable=SC2154
((${#targets[@]})) || exit
# Make matches behave correctly
diff --git a/bash/bash_completion.d/path.bash b/bash/bash_completion.d/path.bash
index 9234f132..c3bb7b80 100644
--- a/bash/bash_completion.d/path.bash
+++ b/bash/bash_completion.d/path.bash
@@ -62,11 +62,11 @@ _path() {
fi
# Break PATH into parts
- declare -a paths
IFS=: read -a paths -d '' -r \
< <(printf '%s\0' "$PATH")
# Print shell-quoted matching parts, null-terminated
+ # shellcheck disable=SC2154
for path in "${paths[@]}" ; do
case $path in
("$2"*) printf '%q\0' "$path" ;;