diff --git a/completions/lvm b/completions/lvm index b3854cfa..4324fcd3 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