[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-305-geefc69d

Ville Skyttä ville.skytta at iki.fi
Mon May 16 15:59:07 UTC 2011


The following commit has been merged in the master branch:
commit eefc69d83b32b9e50ca2d0ca403d2f7a16e4746f
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Mon May 16 18:57:43 2011 +0300

    lvm: Use _parse_usage in several tools.
    
    Also adjust test cases to not fail if --help doesn't succeed, at least
    it doesn't for me if run as non-root.

diff --git a/completions/lvm b/completions/lvm
index b659a2e..0d7a7f5 100644
--- a/completions/lvm
+++ b/completions/lvm
@@ -51,8 +51,7 @@ _lvmdiskscan()
     _init_completion || return
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--debug --help \
-            --lvmpartition --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     fi
 } &&
 complete -F _lvmdiskscan lvmdiskscan
@@ -90,10 +89,7 @@ _pvs()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--aligned --all --debug \
-            --help --ignorelockingfailure --noheadings \
-            --nosuffix --options --sort --separator --unbuffered --units \
-            --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _physicalvolumes
     fi
@@ -113,8 +109,7 @@ _pvdisplay()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--colon --columns --units \
-            --verbose --debug --help --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _physicalvolumes
     fi
@@ -134,10 +129,7 @@ _pvchange()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--all --autobackup \
-            --debug --help --test --uuid \
-            --allocatable --verbose --addtag --deltag \
-            --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _physicalvolumes
     fi
@@ -169,11 +161,7 @@ _pvcreate()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--restorefile --debug \
-            --force --help --labelsector --metadatatype \
-            --metadatacopies --metadatasize \
-            --setphysicalvolumesize --test --uuid \
-            --verbose --yes --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _physicalvolumes
     fi
@@ -211,8 +199,7 @@ _pvremove()
     _init_completion || return
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--debug --force \
-            --help --yes --test --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _physicalvolumes
     fi
@@ -225,9 +212,7 @@ _vgscan()
     _init_completion || return
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--debug --help \
-            --ignorelockingfailure --mknodes \
-            --partial --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     fi
 } &&
 complete -F _vgscan vgscan
@@ -253,11 +238,7 @@ _vgs()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--aligned --debug \
-            --help --ignorelockingfailure --noheadings \
-            --nosuffix --options --sort --partial \
-            --separator --unbuffered --units \
-            --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _volumegroups
     fi
@@ -277,9 +258,7 @@ _vgdisplay()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--colon --columns --units \
-            --partial --activevolumegroups --verbose \
-            --debug --help --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _volumegroups
     fi
@@ -352,8 +331,7 @@ _vgremove()
     _init_completion || return
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--debug --help --test \
-            --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _volumegroups
     fi
@@ -373,8 +351,7 @@ _vgrename()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--autobackup --debug \
-            --help --test --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _volumegroups
     fi
@@ -394,9 +371,7 @@ _vgreduce()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--all --autobackup \
-            --debug --help --removemissing --test \
-            --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
 
     else
         _args
@@ -426,8 +401,7 @@ _vgextend()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--autobackup --debug \
-            --help --test --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _args
         if [ $args -eq 0 ]; then
@@ -445,8 +419,7 @@ _vgport()
     _init_completion || return
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--all --debug \
-            --help --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _volumegroups
     fi
@@ -459,8 +432,7 @@ _vgck()
     _init_completion || return
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--debug \
-            --help --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _volumegroups
     fi
@@ -488,9 +460,7 @@ _vgconvert()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--debug --help --labelsector \
-            --metadatatype --metadatacopies --metadatasize \
-            --test --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _volumegroups
     fi
@@ -510,9 +480,7 @@ _vgcfgbackup()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--debug --file --help \
-            --ignorelockingfailure --partial --verbose \
-            --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _volumegroups
     fi
@@ -540,9 +508,7 @@ _vgcfgrestore()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--debug --file --list \
-            --help --metadatatype --name --test \
-            --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _volumegroups
     fi
@@ -562,8 +528,7 @@ _vgmerge()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--autobackup --debug --help \
-            --list --test --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _volumegroups
     fi
@@ -607,8 +572,7 @@ _vgmknodes()
     _init_completion || return
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--debug --help --verbose \
-            --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _volumegroups
     fi
@@ -621,9 +585,7 @@ _lvscan()
     _init_completion || return
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--blockdevice --debug \
-            --help --ignorelockingfailure \
-            --partial --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     fi
 } &&
 complete -F _lvscan lvscan
@@ -647,10 +609,7 @@ _lvs()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--aligned --debug --help \
-            --ignorelockingfailure --noheadings --nosuffix --options \
-            --sort --partial --segments --separator --unbuffered --units \
-            --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _logicalvolumes
     fi
@@ -670,8 +629,7 @@ _lvdisplay()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--colon --columns --units \
-            --partial --maps --verbose --debug --help --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _logicalvolumes
     fi
@@ -695,12 +653,7 @@ _lvchange()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--autobackup --available \
-            --addtag --alloc --contiguous --debug --deltag \
-            --force --help --ignorelockingfailure \
-            --persistent --major --minor --partial \
-            --permission --readahead --refresh --test \
-            --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _logicalvolumes
     fi
@@ -732,12 +685,7 @@ _lvcreate()
     esac
 
     if [[ "$cur" == -* ]]; then
-        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" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _args
         if [ $args -eq 0 ]; then
@@ -762,8 +710,7 @@ _lvremove()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--autobackup --debug \
-            --force --help --test --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _logicalvolumes
     fi
@@ -783,8 +730,7 @@ _lvrename()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--autobackup --debug \
-            --help --test --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _logicalvolumes
     fi
@@ -808,9 +754,7 @@ _lvreduce()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--autobackup \
-            --debug --force --help --extents \
-            --size --nofsck --resizefs --test --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _logicalvolumes
     fi
@@ -834,10 +778,7 @@ _lvresize()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--autobackup --alloc \
-            --debug --help --stripes --stripesize \
-            --extents --size --nofsck --resizefs \
-            --test --type --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _args
         if [ $args -eq 0 ]; then
@@ -866,10 +807,7 @@ _lvextend()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '--autobackup --alloc \
-            --debug --help --stripes --stripesize \
-            --extents --size --nofsck --resizefs \
-            --test --type --verbose --version' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _args
         if [ $args -eq 0 ]; then
diff --git a/test/lib/completions/lvchange.exp b/test/lib/completions/lvchange.exp
index 6587a26..2240e5e 100644
--- a/test/lib/completions/lvchange.exp
+++ b/test/lib/completions/lvchange.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "lvchange --"
+if {[assert_exec {lvchange --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "lvchange --"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/lvcreate.exp b/test/lib/completions/lvcreate.exp
index 91cb0d8..678ac1b 100644
--- a/test/lib/completions/lvcreate.exp
+++ b/test/lib/completions/lvcreate.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "lvcreate --"
+if {[assert_exec {lvcreate --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "lvcreate --"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/lvdisplay.exp b/test/lib/completions/lvdisplay.exp
index 6fa9c29..5e8c321 100644
--- a/test/lib/completions/lvdisplay.exp
+++ b/test/lib/completions/lvdisplay.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "lvdisplay --"
+if {[assert_exec {lvdisplay --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "lvdisplay --"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/lvextend.exp b/test/lib/completions/lvextend.exp
index ded3469..7c0e329 100644
--- a/test/lib/completions/lvextend.exp
+++ b/test/lib/completions/lvextend.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "lvextend --"
+if {[assert_exec {lvextend --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "lvextend --"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/lvmdiskscan.exp b/test/lib/completions/lvmdiskscan.exp
index 6553865..30c73c5 100644
--- a/test/lib/completions/lvmdiskscan.exp
+++ b/test/lib/completions/lvmdiskscan.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "lvmdiskscan --"
+if {[assert_exec {lvmdiskscan --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "lvmdiskscan --"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/lvreduce.exp b/test/lib/completions/lvreduce.exp
index e2708f8..b9904fe 100644
--- a/test/lib/completions/lvreduce.exp
+++ b/test/lib/completions/lvreduce.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "lvreduce --"
+if {[assert_exec {lvreduce --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "lvreduce --"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/lvremove.exp b/test/lib/completions/lvremove.exp
index 8ca1517..0f41d8d 100644
--- a/test/lib/completions/lvremove.exp
+++ b/test/lib/completions/lvremove.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "lvremove --"
+if {[assert_exec {lvremove --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "lvremove --"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/lvrename.exp b/test/lib/completions/lvrename.exp
index 17179ce..77d6c5e 100644
--- a/test/lib/completions/lvrename.exp
+++ b/test/lib/completions/lvrename.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "lvrename --"
+if {[assert_exec {lvrename --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "lvrename --"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/lvresize.exp b/test/lib/completions/lvresize.exp
index 2b3e104..a0e8f99 100644
--- a/test/lib/completions/lvresize.exp
+++ b/test/lib/completions/lvresize.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "lvresize --"
+if {[assert_exec {lvresize --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "lvresize --"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/lvs.exp b/test/lib/completions/lvs.exp
index e531f7e..c46a815 100644
--- a/test/lib/completions/lvs.exp
+++ b/test/lib/completions/lvs.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "lvs --"
+if {[assert_exec {lvs --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "lvs --"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/lvscan.exp b/test/lib/completions/lvscan.exp
index 7b09e5e..60effb5 100644
--- a/test/lib/completions/lvscan.exp
+++ b/test/lib/completions/lvscan.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "lvscan --"
+if {[assert_exec {lvscan --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "lvscan --"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/pvchange.exp b/test/lib/completions/pvchange.exp
index a43ae9c..f317b52 100644
--- a/test/lib/completions/pvchange.exp
+++ b/test/lib/completions/pvchange.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "pvchange --"
+if {[assert_exec {pvchange --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "pvchange --"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/pvcreate.exp b/test/lib/completions/pvcreate.exp
index 6bc9d4e..6e36b36 100644
--- a/test/lib/completions/pvcreate.exp
+++ b/test/lib/completions/pvcreate.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "pvcreate --"
+if {[assert_exec {pvcreate --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "pvcreate --"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/pvdisplay.exp b/test/lib/completions/pvdisplay.exp
index b9db558..7b1df0c 100644
--- a/test/lib/completions/pvdisplay.exp
+++ b/test/lib/completions/pvdisplay.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "pvdisplay --"
+if {[assert_exec {pvdisplay --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "pvdisplay --"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/pvremove.exp b/test/lib/completions/pvremove.exp
index 1febcf3..6d655e7 100644
--- a/test/lib/completions/pvremove.exp
+++ b/test/lib/completions/pvremove.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "pvremove --"
+if {[assert_exec {pvremove --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "pvremove --"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/pvs.exp b/test/lib/completions/pvs.exp
index e50501a..195665f 100644
--- a/test/lib/completions/pvs.exp
+++ b/test/lib/completions/pvs.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "pvs --"
+if {[assert_exec {pvs --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "pvs --"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/vgcfgbackup.exp b/test/lib/completions/vgcfgbackup.exp
index b7e509a..14162ee 100644
--- a/test/lib/completions/vgcfgbackup.exp
+++ b/test/lib/completions/vgcfgbackup.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "vgcfgbackup -"
+if {[assert_exec {vgcfgbackup --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "vgcfgbackup -"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/vgcfgrestore.exp b/test/lib/completions/vgcfgrestore.exp
index e40cd21..2cf5f1c 100644
--- a/test/lib/completions/vgcfgrestore.exp
+++ b/test/lib/completions/vgcfgrestore.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "vgcfgrestore -"
+if {[assert_exec {vgcfgrestore --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "vgcfgrestore -"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/vgck.exp b/test/lib/completions/vgck.exp
index b4d58ae..b2c86da 100644
--- a/test/lib/completions/vgck.exp
+++ b/test/lib/completions/vgck.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "vgck -"
+if {[assert_exec {vgck --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "vgck -"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/vgconvert.exp b/test/lib/completions/vgconvert.exp
index 362c44b..f432229 100644
--- a/test/lib/completions/vgconvert.exp
+++ b/test/lib/completions/vgconvert.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "vgconvert -"
+if {[assert_exec {vgconvert --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "vgconvert -"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/vgdisplay.exp b/test/lib/completions/vgdisplay.exp
index 6a8ed84..5fd2059 100644
--- a/test/lib/completions/vgdisplay.exp
+++ b/test/lib/completions/vgdisplay.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "vgdisplay -"
+if {[assert_exec {vgdisplay --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "vgdisplay -"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/vgexport.exp b/test/lib/completions/vgexport.exp
index 2900960..e6e45d0 100644
--- a/test/lib/completions/vgexport.exp
+++ b/test/lib/completions/vgexport.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "vgexport -"
+if {[assert_exec {vgexport --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "vgexport -"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/vgextend.exp b/test/lib/completions/vgextend.exp
index 3c46a8f..18dc201 100644
--- a/test/lib/completions/vgextend.exp
+++ b/test/lib/completions/vgextend.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "vgextend -"
+if {[assert_exec {vgextend --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "vgextend -"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/vgimport.exp b/test/lib/completions/vgimport.exp
index ed04e28..f4c1f83 100644
--- a/test/lib/completions/vgimport.exp
+++ b/test/lib/completions/vgimport.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "vgimport -"
+if {[assert_exec {vgimport --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "vgimport -"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/vgmerge.exp b/test/lib/completions/vgmerge.exp
index a4f8833..a836684 100644
--- a/test/lib/completions/vgmerge.exp
+++ b/test/lib/completions/vgmerge.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "vgmerge -"
+if {[assert_exec {vgmerge --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "vgmerge -"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/vgmknodes.exp b/test/lib/completions/vgmknodes.exp
index 5c9feeb..b8c3d57 100644
--- a/test/lib/completions/vgmknodes.exp
+++ b/test/lib/completions/vgmknodes.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "vgmknodes -"
+if {[assert_exec {vgmknodes --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "vgmknodes -"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/vgreduce.exp b/test/lib/completions/vgreduce.exp
index f6af315..fc34968 100644
--- a/test/lib/completions/vgreduce.exp
+++ b/test/lib/completions/vgreduce.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "vgreduce -"
+if {[assert_exec {vgreduce --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "vgreduce -"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/vgremove.exp b/test/lib/completions/vgremove.exp
index 0dc5eda..0ec1011 100644
--- a/test/lib/completions/vgremove.exp
+++ b/test/lib/completions/vgremove.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "vgremove -"
+if {[assert_exec {vgremove --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "vgremove -"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/vgrename.exp b/test/lib/completions/vgrename.exp
index 8143863..62e7d3e 100644
--- a/test/lib/completions/vgrename.exp
+++ b/test/lib/completions/vgrename.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "vgrename -"
+if {[assert_exec {vgrename --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "vgrename -"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/vgs.exp b/test/lib/completions/vgs.exp
index 22ab176..8a6cf65 100644
--- a/test/lib/completions/vgs.exp
+++ b/test/lib/completions/vgs.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "vgs -"
+if {[assert_exec {vgs --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "vgs -"
+}
 
 
 sync_after_int
diff --git a/test/lib/completions/vgscan.exp b/test/lib/completions/vgscan.exp
index ae8168c..a26838f 100644
--- a/test/lib/completions/vgscan.exp
+++ b/test/lib/completions/vgscan.exp
@@ -11,7 +11,9 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "vgscan -"
+if {[assert_exec {vgscan --help} "" "" "untested"]} { # may fail as non-root
+    assert_complete_any "vgscan -"
+}
 
 
 sync_after_int

-- 
bash-completion



More information about the Bash-completion-commits mailing list