[Bash-completion-commits] [bash-completion] 02/02: Various mostly array element unsetting fixes under failglob

Ville Skyttä scop-guest at moszumanska.debian.org
Tue Jun 3 20:11:33 UTC 2014


This is an automated email from the git hooks/post-receive script.

scop-guest pushed a commit to branch master
in repository bash-completion.

commit 1ed2377c895d3f1826df0820d992f746c10373a9
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Tue Jun 3 23:09:56 2014 +0300

    Various mostly array element unsetting fixes under failglob
---
 completions/badblocks |  2 +-
 completions/crontab   | 10 +++++-----
 completions/cvs       |  6 +++---
 completions/find      |  2 +-
 completions/info      |  2 +-
 completions/lvm       |  2 +-
 completions/modprobe  |  2 +-
 completions/protoc    |  2 +-
 completions/qdbus     |  4 ++--
 9 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/completions/badblocks b/completions/badblocks
index 2dc8eb4..8ed84b1 100644
--- a/completions/badblocks
+++ b/completions/badblocks
@@ -19,7 +19,7 @@ _badblocks()
         COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
         # Filter out -w (dangerous) and -X (internal use)
         for i in ${!COMPREPLY[@]}; do
-            [[ ${COMPREPLY[i]} == -[wX] ]] && unset COMPREPLY[i]
+            [[ ${COMPREPLY[i]} == -[wX] ]] && unset 'COMPREPLY[i]'
         done
         return 0
     fi
diff --git a/completions/crontab b/completions/crontab
index bc15b52..02cc53d 100644
--- a/completions/crontab
+++ b/completions/crontab
@@ -18,19 +18,19 @@ _crontab()
 
     local i
     for (( i=0; i < ${#words[@]}-1; i++ )); do
-        [[ ${words[i]} ]] && unset opts[${words[i]}]
+        [[ ${words[i]} ]] && unset "opts[${words[i]}]"
         case "${words[i]}" in
             -l)
-                unset opts[-r] opts[-e] opts[-i] opts[-s]
+                unset 'opts[-r]' 'opts[-e]' 'opts[-i]' 'opts[-s]'
                 ;;
             -e)
-                unset opts[-l] opts[-r] opts[-i]
+                unset 'opts[-l]' 'opts[-r]' 'opts[-i]'
                 ;;
             -r)
-                unset opts[-l] opts[-e]
+                unset 'opts[-l]' 'opts[-e]'
                 ;;
             -u)
-                unset opts[-i]
+                unset 'opts[-i]'
                 ;;
         esac
     done
diff --git a/completions/cvs b/completions/cvs
index 6c72efe..56c2378 100644
--- a/completions/cvs
+++ b/completions/cvs
@@ -156,11 +156,11 @@ _cvs()
                 local f
                 for i in ${!files[@]}; do
                     if [[ ${files[i]} == ?(*/)CVS ]]; then
-                        unset files[i]
+                        unset 'files[i]'
                     else
                         for f in "${entries[@]}"; do
                             if [[ ${files[i]} == $f && ! -d $f ]]; then
-                                unset files[i]
+                                unset 'files[i]'
                                 break
                             fi
                         done
@@ -337,7 +337,7 @@ _cvs()
                 if [[ "$prev" != -f ]]; then
                     # find out what files are missing
                     for i in ${!entries[@]}; do
-                        [[ -r "${entries[i]}" ]] && unset entries[i]
+                        [[ -r "${entries[i]}" ]] && unset 'entries[i]'
                     done
                 fi
                 COMPREPLY=( $( compgen -W '${entries[@]:-}' -- "$cur" ) )
diff --git a/completions/find b/completions/find
index 78e16f4..b543b6f 100644
--- a/completions/find
+++ b/completions/find
@@ -101,7 +101,7 @@ _find()
         for i in "${words[@]}"; do
             [[ $i && ${onlyonce[$i]} ]] || continue
             for j in ${!COMPREPLY[@]}; do
-                [[ ${COMPREPLY[j]} == $i ]] && unset COMPREPLY[j]
+                [[ ${COMPREPLY[j]} == $i ]] && unset 'COMPREPLY[j]'
             done
         done
     fi
diff --git a/completions/info b/completions/info
index 3655044..fa958ff 100644
--- a/completions/info
+++ b/completions/info
@@ -62,7 +62,7 @@ _info()
     COMPREPLY=( ${COMPREPLY[@]##*/?(:)} )
     # weed out info dir file
     for (( i=0 ; i < ${#COMPREPLY[@]} ; ++i )); do
-        [[ ${COMPREPLY[$i]} == dir ]] && unset COMPREPLY[$i]
+        [[ ${COMPREPLY[$i]} == dir ]] && unset "COMPREPLY[$i]"
     done
     # strip suffix from info pages
     COMPREPLY=( ${COMPREPLY[@]%.@(gz|bz2|xz|lzma)} )
diff --git a/completions/lvm b/completions/lvm
index ba0720e..2b5b8b9 100644
--- a/completions/lvm
+++ b/completions/lvm
@@ -20,7 +20,7 @@ _lvm_logicalvolumes()
         _filedir
         local i
         for i in ${!COMPREPLY[@]}; do
-            [[ ${COMPREPLY[i]} == */control ]] && unset COMPREPLY[i]
+            [[ ${COMPREPLY[i]} == */control ]] && unset 'COMPREPLY[i]'
         done
     fi
 }
diff --git a/completions/modprobe b/completions/modprobe
index b59e4dc..4bc3ebc 100644
--- a/completions/modprobe
+++ b/completions/modprobe
@@ -84,7 +84,7 @@ _modprobe()
                     for i in ${!mods[@]}; do
                         for module in ${COMPREPLY[@]}; do
                             if [[ ${mods[i]} == $module ]]; then
-                                unset mods[i]
+                                unset 'mods[i]'
                                 break
                             fi
                         done
diff --git a/completions/protoc b/completions/protoc
index 4621cf6..6bc67eb 100644
--- a/completions/protoc
+++ b/completions/protoc
@@ -49,7 +49,7 @@ _protoc()
             COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
             local i
             for i in ${!COMPREPLY[@]}; do
-                [[ ${COMPREPLY[i]} == -oFILE ]] && unset COMPREPLY[i]
+                [[ ${COMPREPLY[i]} == -oFILE ]] && unset 'COMPREPLY[i]'
             done
             [[ $COMPREPLY == *= ]] && compopt -o nospace
             return
diff --git a/completions/qdbus b/completions/qdbus
index a098fbc..fa23f85 100644
--- a/completions/qdbus
+++ b/completions/qdbus
@@ -5,9 +5,9 @@ _qdbus()
     local cur prev words cword
     _init_completion || return
 
-    [[ -n $cur ]] && unset words[${#words[@]}-1]
+    [[ -n $cur ]] && unset "words[$((${#words[@]}-1))]"
     COMPREPLY=( $( compgen -W '$( command ${words[@]} 2>/dev/null | \
-        sed s/\(.*\)// )' -- "$cur" ) )
+        sed "s/(.*)//" )' -- "$cur" ) )
 } &&
 complete -F _qdbus qdbus dcop
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/bash-completion/bash-completion.git



More information about the Bash-completion-commits mailing list