diff options
Diffstat (limited to 'contrib/lvm')
-rw-r--r-- | contrib/lvm | 440 |
1 files changed, 203 insertions, 237 deletions
diff --git a/contrib/lvm b/contrib/lvm index 647564ab..f4d3b77d 100644 --- a/contrib/lvm +++ b/contrib/lvm @@ -49,11 +49,11 @@ _lvmdiskscan() local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -h -? --help -l \ - --lvmpartition -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--debug --help \ + --lvmpartition --verbose --version' -- "$cur" ) ) fi } complete -F _lvmdiskscan lvmdiskscan @@ -63,13 +63,11 @@ _pvscan() local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -e \ - --exported -n --novolumegroup -h -? \ - --help --ignorelockingfailure -P \ - --partial -s --short -u --uuid -v \ + COMPREPLY=( $( compgen -W '--debug --exported --novolumegroup \ + --help --ignorelockingfailure --partial --short --uuid \ --verbose --version' -- "$cur" ) ) fi } @@ -80,11 +78,10 @@ _pvs() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(o|O|-options|-sort)) + case $prev in + -o|-O|--options|--sort) COMPREPLY=( $( compgen -W 'pv_fmt pv_uuid \ pv_size pv_free pv_used pv_name \ pv_attr pv_pe_count \ @@ -98,11 +95,10 @@ _pvs() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--aligned -a --all -d --debug \ - -h -? --help --ignorelockingfailure --noheadings \ - --nosuffix -o --options -O --sort \ - --separator --unbuffered --units \ - -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--aligned --all --debug \ + --help --ignorelockingfailure --noheadings \ + --nosuffix --options --sort --separator --unbuffered --units \ + --verbose --version' -- "$cur" ) ) else _physicalvolumes fi @@ -114,10 +110,9 @@ _pvdisplay() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in --units) _units return 0 @@ -125,8 +120,8 @@ _pvdisplay() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-c --colon -C --columns --units \ - -v --verbose -d --debug -h --help --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--colon --columns --units \ + --verbose --debug --help --version' -- "$cur" ) ) else _physicalvolumes fi @@ -138,20 +133,19 @@ _pvchange() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(A|x|-autobackup|--allocatable)) + case $prev in + -A|-x|--autobackup|--allocatable) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-a --all -A --autobackup \ - -d --debug -h --help -t --test -u --uuid -x \ - --allocatable -v --verbose --addtag --deltag \ + COMPREPLY=( $( compgen -W '--all --autobackup \ + --debug --help --test --uuid \ + --allocatable --verbose --addtag --deltag \ --version' -- "$cur" ) ) else _physicalvolumes @@ -164,15 +158,14 @@ _pvcreate() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in --restorefile) _filedir return 0 ;; - -@(M|-metadatatype)) + -M|--metadatatype) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) return 0 ;; @@ -180,18 +173,18 @@ _pvcreate() COMPREPLY=( $( compgen -W '0 1 2' -- "$cur" ) ) return 0 ;; - --@(metadatasize|setphysicalvolumesize)) + --metadatasize|--setphysicalvolumesize) _sizes return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--restorefile -d --debug -f \ - --force -h -? --help --labelsector -M --metadatatype \ + COMPREPLY=( $( compgen -W '--restorefile --debug \ + --force --help --labelsector --metadatatype \ --metadatacopies --metadatasize \ - --setphysicalvolumesize -t --test -u --uuid uuid -v \ - --verbose -y --yes --version' -- "$cur" ) ) + --setphysicalvolumesize --test --uuid \ + --verbose --yes --version' -- "$cur" ) ) else _physicalvolumes fi @@ -203,24 +196,22 @@ _pvmove() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(A|-autobackup)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; - -@(n|-name)) + -n|--name) _logicalvolumes return 0 esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--abort -A --autobackup \ - -b --background -d --debug -f --force -h -? \ - --help -i --interval -t --test -v --verbose \ - --version -n --name' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--abort --autobackup \ + --background --debug --force --help --interval --test --verbose \ + --version --name' -- "$cur" ) ) else _physicalvolumes fi @@ -232,12 +223,11 @@ _pvremove() local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -f --force -h -? \ - --help -y --yes -t --test -v --verbose \ - --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--debug --force \ + --help --yes --test --verbose --version' -- "$cur" ) ) else _physicalvolumes fi @@ -249,12 +239,12 @@ _vgscan() local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -h --help \ - --ignorelockingfailure --mknodes -P \ - --partial -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--debug --help \ + --ignorelockingfailure --mknodes \ + --partial --verbose --version' -- "$cur" ) ) fi } complete -F _vgscan vgscan @@ -264,11 +254,10 @@ _vgs() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(o|O|-options|-sort)) + case $prev in + -o|-O|--options|--sort) COMPREPLY=( $( compgen -W 'vg_fmt vg_uuid vg_name \ vg_attr vg_size vg_free vg_sysid \ vg_extent_size vg_extent_count vg_free_count \ @@ -283,11 +272,11 @@ _vgs() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--aligned -d --debug \ - -h --help --ignorelockingfailure --noheadings \ - --nosuffix -o --options -O --sort -P --partial \ + COMPREPLY=( $( compgen -W '--aligned --debug \ + --help --ignorelockingfailure --noheadings \ + --nosuffix --options --sort --partial \ --separator --unbuffered --units \ - -v --verbose --version' -- "$cur" ) ) + --verbose --version' -- "$cur" ) ) else _volumegroups fi @@ -299,10 +288,9 @@ _vgdisplay() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in --units) _units return 0 @@ -310,9 +298,9 @@ _vgdisplay() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-c --colon -C --columns --units \ - -P --partial -A --activevolumegroups -v --verbose \ - -d --debug -h --help --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--colon --columns --units \ + --partial --activevolumegroups --verbose \ + --debug --help --version' -- "$cur" ) ) else _volumegroups fi @@ -324,21 +312,20 @@ _vgchange() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(a|A|x|-available|-autobackup|-resizeable)) + case $prev in + -a|-A|-x|--available|--autobackup|--resizeable) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup --alloc -P \ - --partial -d --debug -h --help --ignorelockingfailure \ - -t --test -u --uuid -v --verbose --version -a \ - --available -x --resizeable -l --logicalvolume \ + COMPREPLY=( $( compgen -W '--autobackup --alloc \ + --partial --debug --help --ignorelockingfailure \ + --test --uuid --verbose --version \ + --available --resizeable --logicalvolume \ --addtag --deltag' -- "$cur" ) ) else _volumegroups @@ -351,28 +338,27 @@ _vgcreate() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(A|-autobackup)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; - -@(M|-metadatatype)) + -M|--metadatatype) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) return 0 ;; - -@(s|-physicalextentsize)) + -s|--physicalextentsize) _sizes return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup --addtag --alloc -d \ - --debug -h --help -l --maxlogicalvolumes -M --metadatatype -p \ - --maxphysicalvolumes -s --physicalextentsize -t --test -v \ + COMPREPLY=( $( compgen -W '--autobackup --addtag --alloc \ + --debug --help --maxlogicalvolumes --metadatatype \ + --maxphysicalvolumes --physicalextentsize --test \ --verbose --version' -- "$cur" ) ) else _args @@ -390,11 +376,11 @@ _vgremove() local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -h --help -t --test \ - -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--debug --help --test \ + --verbose --version' -- "$cur" ) ) else _volumegroups fi @@ -406,19 +392,18 @@ _vgrename() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(A|-autobackup)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup -d --debug -h \ - -? --help -t --test -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --debug \ + --help --test --verbose --version' -- "$cur" ) ) else _volumegroups fi @@ -430,19 +415,18 @@ _vgreduce() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(A|-autobackup)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-a --all -A --autobackup -d \ - --debug -h --help --removemissing -t --test -v \ + COMPREPLY=( $( compgen -W '--all --autobackup \ + --debug --help --removemissing --test \ --verbose --version' -- "$cur" ) ) else @@ -461,23 +445,22 @@ _vgextend() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(A|-autobackup)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; - -@(L|-size)) + -L|--size) _sizes return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup -d --debug -h \ - -? --help -t --test -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --debug \ + --help --test --verbose --version' -- "$cur" ) ) else _args if [ $args -eq 0 ]; then @@ -494,11 +477,11 @@ _vgport() local cur prev COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-a --all -d --debug -h \ - -? --help -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--all --debug \ + --help --verbose --version' -- "$cur" ) ) else _volumegroups fi @@ -507,14 +490,14 @@ complete -F _vgport vgimport vgexport _vgck() { - local cur prev + local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -h \ - -? --help -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--debug \ + --help --verbose --version' -- "$cur" ) ) else _volumegroups fi @@ -526,11 +509,10 @@ _vgconvert() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(M|-metadatatype)) + case $prev in + -M|--metadatatype) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) return 0 ;; @@ -545,9 +527,9 @@ _vgconvert() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -h --help --labelsector \ - -M --metadatatype --metadatacopies --metadatasize \ - -t --test -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--debug --help --labelsector \ + --metadatatype --metadatacopies --metadatasize \ + --test --verbose --version' -- "$cur" ) ) else _volumegroups fi @@ -559,19 +541,18 @@ _vgcfgbackup() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(f|-file)) + case $prev in + -f|--file) _filedir return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -f --file -h --help \ - --ignorelockingfailure -P --partial -v --verbose \ + COMPREPLY=( $( compgen -W '--debug --file --help \ + --ignorelockingfailure --partial --verbose \ --version' -- "$cur" ) ) else _volumegroups @@ -584,28 +565,27 @@ _vgcfgrestore() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(f|-file)) + case $prev in + -f|--file) _filedir return 0 ;; - -@(M|-metadatatype)) + -M|--metadatatype) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) return 0 ;; - -@(n|-name)) + -n|--name) _volumegroups return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -f --file -l --list \ - -h --help -M --Metadatatype -n --name -t --test \ - -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--debug --file --list \ + --help --metadatatype --name --test \ + --verbose --version' -- "$cur" ) ) else _volumegroups fi @@ -617,19 +597,18 @@ _vgmerge() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(A|-autobackup)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup -d --debug -h --help -l \ - --list -t --test -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --debug --help \ + --list --test --verbose --version' -- "$cur" ) ) else _volumegroups fi @@ -641,27 +620,26 @@ _vgsplit() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(A|-autobackup)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; - -@(M|-metadatatype)) + -M|--metadatatype) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup -d --debug \ - -h --help -l --list -M --metadatatype -t --test \ - -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --debug \ + --help --list --metadatatype --test \ + --verbose --version' -- "$cur" ) ) else _args - if [ $args -eq 0 -o $args -eq 1 ]; then + if [[ $args -eq 0 || $args -eq 1 ]]; then _volumegroups else _physicalvolumes @@ -675,10 +653,10 @@ _vgmknodes() local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -h --help -v --verbose \ + COMPREPLY=( $( compgen -W '--debug --help --verbose \ --version' -- "$cur" ) ) else _volumegroups @@ -691,12 +669,12 @@ _lvscan() local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-b --blockdevice -d --debug \ - -h -? --help --ignorelockingfailure -P \ - --partial -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--blockdevice --debug \ + --help --ignorelockingfailure \ + --partial --verbose --version' -- "$cur" ) ) fi } complete -F _lvscan lvscan @@ -706,11 +684,10 @@ _lvs() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(o|O|-options|-sort)) + case $prev in + -o|-O|--options|--sort) COMPREPLY=( $( compgen -W 'lv_uuid lv_name lv_attr lv_minor \ lv_size seg_count origin snap_percent segtype stripes \ stripesize chunksize seg_start seg_size' -- "$cur" ) ) @@ -723,10 +700,10 @@ _lvs() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--aligned -d --debug -h --help \ - --ignorelockingfailure --noheadings --nosuffix -o --options -O \ - --sort -P --partial --segments --separator --unbuffered --units \ - -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--aligned --debug --help \ + --ignorelockingfailure --noheadings --nosuffix --options \ + --sort --partial --segments --separator --unbuffered --units \ + --verbose --version' -- "$cur" ) ) else _logicalvolumes fi @@ -738,10 +715,9 @@ _lvdisplay() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in --units) _units return 0 @@ -749,9 +725,8 @@ _lvdisplay() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-c --colon -C --columns --units \ - -P --partial -m --maps -v --verbose -d --debug -h \ - --help --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--colon --columns --units \ + --partial --maps --verbose --debug --help --version' -- "$cur" ) ) else _logicalvolumes fi @@ -763,27 +738,26 @@ _lvchange() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(a|A|C|M|-available|-autobackup|-continguous|-persistent)) + case $prev in + -a|-A|-C|-M|--available|--autobackup|--continguous|--persistent) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; - -@(p|-permission)) + -p|--permission) COMPREPLY=( $( compgen -W 'r rw' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup -a --available \ - --addtag --alloc -C --contiguous -d --debug --deltag \ - -f --force -h --help --ignorelockingfailure -M \ - --persistent --major major --minor minor -P --partial \ - -p --permission -r --readahead --refresh -t --test \ - -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --available \ + --addtag --alloc --contiguous --debug --deltag \ + --force --help --ignorelockingfailure \ + --persistent --major --minor --partial \ + --permission --readahead --refresh --test \ + --verbose --version' -- "$cur" ) ) else _logicalvolumes fi @@ -795,34 +769,33 @@ _lvcreate() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(A|C|M|Z|-autobackup|-continguous|-persistent|-zero)) + case $prev in + -A|-C|-M|-Z|--autobackup|--continguous|--persistent|--zero) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; - -@(L|-size)) + -L|--size) _sizes return 0 ;; - -@(p|-permission)) + -p|--permission) COMPREPLY=( $( compgen -W 'r rw' -- "$cur" ) ) return 0 ;; - -@(n|-name)) + -n|--name) _logicalvolumes return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup --addtag --alloc \ - -C --contiguous -d --debug -h -? --help -i --stripes \ - -I --stripesize -l --extents -L --size -M --persistent \ - --major --minor -n --name -p --permission -r \ - --readahead -t --test --type -v --verbose -Z --zero \ + COMPREPLY=( $( compgen -W '--autobackup --addtag --alloc \ + --contiguous --debug --help --stripes \ + --stripesize --extents --size --persistent \ + --major --minor --name --permission \ + --readahead --test --type --verbose --zero \ --version' -- "$cur" ) ) else _args @@ -840,20 +813,18 @@ _lvremove() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(A|-autobackup)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup -d --debug -f \ - --force -h -? --help -t --test -v --verbose \ - --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --debug \ + --force --help --test --verbose --version' -- "$cur" ) ) else _logicalvolumes fi @@ -865,19 +836,18 @@ _lvrename() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(A|-autobackup)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup -d --debug -h \ - -? --help -t --test -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --debug \ + --help --test --verbose --version' -- "$cur" ) ) else _logicalvolumes fi @@ -889,25 +859,23 @@ _lvreduce() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(A|-autobackup)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; - -@(L|-size)) + -L|--size) _sizes return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup -d \ - --debug -f --force -h --help -l --extents \ - -L --size -n --nofsck -r --resizefs -t --test \ - -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup \ + --debug --force --help --extents \ + --size --nofsck --resizefs --test --verbose --version' -- "$cur" ) ) else _logicalvolumes fi @@ -919,25 +887,24 @@ _lvresize() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(A|-autobackup)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; - -@(L|-size)) + -L|--size) _sizes return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup --alloc -d \ - --debug -h --help -i --stripes -I --stripesize \ - -l --extents -L --size -n --nofsck -r --resizefs \ - -t --test --type -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --alloc \ + --debug --help --stripes --stripesize \ + --extents --size --nofsck --resizefs \ + --test --type --verbose --version' -- "$cur" ) ) else _args if [ $args -eq 0 ]; then @@ -954,25 +921,24 @@ _lvextend() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(A|-autobackup)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; - -@(L|-size)) + -L|--size) _sizes return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup --alloc -d \ - --debug -h --help -i --stripes -I --stripesize \ - -l --extents -L --size -n --nofsck -r --resizefs \ - -t --test --type -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --alloc \ + --debug --help --stripes --stripesize \ + --extents --size --nofsck --resizefs \ + --test --type --verbose --version' -- "$cur" ) ) else _args if [ $args -eq 0 ]; then @@ -986,10 +952,10 @@ complete -F _lvextend lvextend _lvm() { - local prev + local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [ $COMP_CWORD -eq 1 ]; then COMPREPLY=( $( compgen -W 'dumpconfig help lvchange \ |