[Bash-completion-commits] [SCM] bash-completion branch, master, updated. eced7126a30bb62c49924f0b2dc61f0131317c00

Guillaume Rousse guillomovitch at zarb.org
Sun May 17 20:13:20 UTC 2009


The following commit has been merged in the master branch:
commit abaec12fb60fef1e43d05865ce3fc275b9c0cf17
Author: Guillaume Rousse <guillomovitch at zarb.org>
Date:   Sun May 17 22:02:37 2009 +0200

    split bzip2 completion

diff --git a/bash_completion b/bash_completion
index dac9bae..978139e 100644
--- a/bash_completion
+++ b/bash_completion
@@ -3466,46 +3466,6 @@ _mysqladmin()
 } &&
 complete -F _mysqladmin mysqladmin
 
-# bzip2(1) completion
-#
-have bzip2 &&
-_bzip2()
-{
-	local cur prev xspec
-
-	COMPREPLY=()
-	cur=`_get_cword`
-	prev=${COMP_WORDS[COMP_CWORD-1]}
-
-	if [[ "$cur" == -* ]]; then
-		COMPREPLY=( $( compgen -W '-c -d -f -h -k -L -q -s \
-			-t -v -V -z -1 -2 -3 -4 -5 -6 -7 -8 -9 \
-			--help --decompress --compress --keep --force \
-			--test --stdout --quiet --verbose --license \
-			--version --small --fast --best' -- $cur ) )
-		return 0
-	fi
-
-	local IFS=$'\t\n'
-
-	xspec="*.bz2"
-	if [[ "$prev" == --* ]]; then
-		[[ "$prev" == --decompress || \
-			"$prev" == --list || \
-			"$prev" == --test ]] && xspec="!"$xspec
-		[[ "$prev" == --compress ]] && xspec=
-	elif [[ "$prev" == -* ]]; then
-		[[ "$prev" == -*[dt]* ]] && xspec="!"$xspec
-		[[ "$prev" == -*z* ]] && xspec=
-	fi
-
-	_expand || return 0
-
-	COMPREPLY=( $( compgen -f -X "$xspec" -- $cur ) \
-		    $( compgen -d -- $cur ) )
-} &&
-complete -F _bzip2 $filenames bzip2
-
 # openssl(1) completion
 #
 have openssl && {
diff --git a/contrib/lzma b/contrib/bzip2
similarity index 74%
copy from contrib/lzma
copy to contrib/bzip2
index 99005bc..0e36269 100644
--- a/contrib/lzma
+++ b/contrib/bzip2
@@ -1,10 +1,10 @@
 # -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
 # ex: ts=8 sw=8 noet filetype=sh
 #
-# lzma(1) completion by Per Øyvind Karlsen <peroyvind at mandriva.org>
-#
-have lzma &&
-_lzma()
+# bash completion for bzip2
+
+have bzip2 &&
+_bzip2()
 {
 	local cur prev xspec
 
@@ -14,16 +14,16 @@ _lzma()
 
 	if [[ "$cur" == -* ]]; then
 		COMPREPLY=( $( compgen -W '-c -d -f -h -k -L -q -s \
-			-v -V -z -1 -2 -3 -4 -5 -6 -7 -8 -9 \
+			-t -v -V -z -1 -2 -3 -4 -5 -6 -7 -8 -9 \
 			--help --decompress --compress --keep --force \
 			--test --stdout --quiet --verbose --license \
-			--version --small --fast --best --text' -- $cur ) )
+			--version --small --fast --best' -- $cur ) )
 		return 0
 	fi
 
 	local IFS=$'\t\n'
 
-	xspec="*.lzma"
+	xspec="*.bz2"
 	if [[ "$prev" == --* ]]; then
 		[[ "$prev" == --decompress || \
 			"$prev" == --list || \
@@ -37,6 +37,6 @@ _lzma()
 	_expand || return 0
 
 	COMPREPLY=( $( compgen -f -X "$xspec" -- $cur ) \
-		$( compgen -d -- $cur ) )
+		    $( compgen -d -- $cur ) )
 } &&
-complete -F _lzma $filenames lzma
+complete -F _bzip2 $filenames bzip2

-- 
bash-completion



More information about the Bash-completion-commits mailing list