[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 2.0-69-gb2d985c

Ville Skyttä ville.skytta at iki.fi
Tue Nov 6 20:52:39 UTC 2012


The following commit has been merged in the master branch:
commit b2d985c0bf9c0013a86cb63247d67b0ed39c9e75
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Tue Nov 6 22:50:38 2012 +0200

    lv{create,resize,extend}, vg{create,reduce,extend,split}: Fix variable leaks.

diff --git a/completions/lvm b/completions/lvm
index b3854cf..4324fcd 100644
--- a/completions/lvm
+++ b/completions/lvm
@@ -38,10 +38,9 @@ _sizes()
 _args()
 {
     args=0
+    local offset=1 i
     if [[ "${words[0]}" == lvm ]]; then
         offset=2
-    else
-        offset=1
     fi
     for (( i=$offset; i < cword; i++ )); do
         if [[ "${words[i]}" != -* ]]; then
@@ -320,6 +319,7 @@ _vgcreate()
             --maxphysicalvolumes --physicalextentsize --test \
             --verbose --version' -- "$cur" ) )
     else
+        local args
         _args
         if [[ $args -eq 0 ]]; then
             _volumegroups
@@ -379,6 +379,7 @@ _vgreduce()
         COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
 
     else
+        local args
         _args
         if [[ $args -eq 0 ]]; then
             _volumegroups
@@ -408,6 +409,7 @@ _vgextend()
     if [[ "$cur" == -* ]]; then
         COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
+        local args
         _args
         if [[ $args -eq 0 ]]; then
             _volumegroups
@@ -561,6 +563,7 @@ _vgsplit()
             --help --list --metadatatype --test \
             --verbose --version' -- "$cur" ) )
     else
+        local args
         _args
         if [[ $args -eq 0 || $args -eq 1 ]]; then
             _volumegroups
@@ -692,6 +695,7 @@ _lvcreate()
     if [[ "$cur" == -* ]]; then
         COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
+        local args
         _args
         if [[ $args -eq 0 ]]; then
             _volumegroups
@@ -785,6 +789,7 @@ _lvresize()
     if [[ "$cur" == -* ]]; then
         COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
+        local args
         _args
         if [[ $args -eq 0 ]]; then
             _logicalvolumes
@@ -814,6 +819,7 @@ _lvextend()
     if [[ "$cur" == -* ]]; then
         COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
+        local args
         _args
         if [[ $args -eq 0 ]]; then
             _logicalvolumes

-- 
bash-completion



More information about the Bash-completion-commits mailing list