aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-12-01 02:21:27 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-12-01 02:21:27 +1300
commit1a5ad4bc42f558b26aacf56e7604a7740c454f2b (patch)
tree851a3d4b06aef90994a58da3bcc9a80de9bd5b23
parent626593c3712531c251c69be2e561a34da98cdcdf (diff)
downloaddotfiles-1a5ad4bc42f558b26aacf56e7604a7740c454f2b.tar.gz
dotfiles-1a5ad4bc42f558b26aacf56e7604a7740c454f2b.zip
Use array+=() syntax in two Bash completion files
Since these only load with Bash >=4.0, we may as well use the nicer method of adding to arrays.
-rw-r--r--bash/bash_completion.d/find.bash2
-rw-r--r--bash/bash_completion.d/pass.bash2
2 files changed, 2 insertions, 2 deletions
diff --git a/bash/bash_completion.d/find.bash b/bash/bash_completion.d/find.bash
index 007a83bd..85cadfaf 100644
--- a/bash/bash_completion.d/find.bash
+++ b/bash/bash_completion.d/find.bash
@@ -30,7 +30,7 @@ _find() {
local item
while read -r item ; do
[[ -n $item ]] || continue
- COMPREPLY[${#COMPREPLY[@]}]=$item
+ COMPREPLY+=("$item")
done < <(
# If the word being completed starts with a dash, just complete it as
diff --git a/bash/bash_completion.d/pass.bash b/bash/bash_completion.d/pass.bash
index 4a814412..1df8dfb1 100644
--- a/bash/bash_completion.d/pass.bash
+++ b/bash/bash_completion.d/pass.bash
@@ -16,7 +16,7 @@ _pass()
local entry
while IFS= read -rd '' entry ; do
[[ -n $entry ]] || continue
- COMPREPLY[${#COMPREPLY[@]}]=$entry
+ COMPREPLY+=("$entry")
done < <(
# Set shell options to expand globs the way we expect