summaryrefslogtreecommitdiff
blob: 0f9ec4da2da43f3d32e4e94f318066b9507e24b3 (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
30
31
32
--- bash_completion.orig/bash_completion	2005-07-24 05:21:24.000000000 -0400
+++ bash_completion/bash_completion	2005-07-24 05:22:21.000000000 -0400
@@ -2773,16 +2773,16 @@
 		return 0
 		;;
 	+([^IZzjy])f)
-		ext='tar'
-		regex=$ext
+		ext='t@(ar?(.@(Z|gz|bz?(2)))|gz|bz?(2))'
+		regex='t\(ar\(\.\(Z\|gz\|bz2\?\)\)\?\|gz\|bz2\?\)'
 		;;
 	*[Zz]*f)
 		ext='t?(ar.)@(gz|Z)'
-		regex='t\(ar\.\)\(gz\|Z\)'
+		regex='t\(ar\.\)\?\(gz\|Z\)'
 		;;
 	*[Ijy]*f)
 		ext='t?(ar.)bz?(2)'
-		regex='t\(ar\.\)bz2\?'
+		regex='t\(ar\.\)\?bz2\?'
 		;;
 	*)
 		_filedir
@@ -2796,7 +2796,7 @@
 		#
 		# get name of tar file from command line
 		tar=$( echo "$COMP_LINE" | \
-			sed -e 's|^.* \([^ ]*'$regex'\) .*$|\1|' )
+			sed -e 's/^.* \([^ ]*'$regex'\) .*$/\1/' )
 		# devise how to untar and list it
 		untar=t${COMP_WORDS[1]//[^Izjyf]/}