summaryrefslogtreecommitdiff
blob: 35c3d068392b18012edbeb5fd4caf573cc8a0ae1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--- bash_completion.orig/bash_completion	2005-04-20 09:19:28.000000000 -0400
+++ bash_completion/bash_completion	2005-04-20 09:52:28.000000000 -0400
@@ -6755,20 +6755,20 @@
 have lvm && {
 _volumegroups()
 {
-	COMPREPLY=( $( vgscan | \
-		awk -F'"' '/Found/ {if ($2 ~ /^'$cur'/) print $2}' ) )
+	COMPREPLY=( $(compgen -W "$( vgscan 2>/dev/null | \
+	    sed -n -e 's|.*Found.*"\(.*\)".*$|\1|p' )" -- $cur ) )
 }
 
 _physicalvolumes()
 {
-	COMPREPLY=( $( pvscan | \
-		awk '/PV/ {if ($2 ~ /^'$cur'/) print $2}' ) )
+	COMPREPLY=( $(compgen -W "$( pvscan 2>/dev/null | \
+	    sed -n -e 's|^.*PV \(.*\) VG.*$|\1|p' )" -- $cur ) )
 }
 
 _logicalvolumes()
 {
-	COMPREPLY=( $( lvscan 2>/dev/null | \
-		awk -F"'" '{if ($2 ~ /^'$cur'/) print $2}' ) )
+	COMPREPLY=( $(compgen -W "$( lvscan 2>/dev/null | \
+	    sed -n -e "s|^.*'\(.*\)'.*$|\1|p" )" -- $cur ) )
 }
 
 _units()