[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 eee9d4f05f9accfdbc607e7d8056fb843737a2f0
Author: Guillaume Rousse <guillomovitch at zarb.org>
Date:   Sun May 17 22:01:43 2009 +0200

    split gzip completion

diff --git a/bash_completion b/bash_completion
index 0967cff..dac9bae 100644
--- a/bash_completion
+++ b/bash_completion
@@ -3466,48 +3466,6 @@ _mysqladmin()
 } &&
 complete -F _mysqladmin mysqladmin
 
-# gzip(1) completion
-#
-have gzip &&
-_gzip()
-{
-	local cur prev xspec helpopts
-
-	COMPREPLY=()
-	cur=`_get_cword`
-	prev=${COMP_WORDS[COMP_CWORD-1]}
-	helpopts=`_parse_help gzip`
-
-	if [[ "$cur" == -* ]]; then
-		COMPREPLY=( $( compgen -W "$helpopts -2 -3 -4 -5 -6 -7 -8" \
-						-- "$cur" ) )
-		return 0
-	fi
-
-	local IFS=$'\t\n'
-
-	xspec="*.?(t)gz"
-	if [[ "$prev" == --* ]]; then
-		[[ "$prev" == --decompress || \
-			"$prev" == --list || \
-			"$prev" == --test ]] && xspec="!"$xspec
-		[[ "$prev" == --force ]] && xspec=
-	elif [[ "$prev" == -* ]]; then
-		[[ "$prev" == -*[dlt]* ]] && xspec="!"$xspec
-		[[ "$prev" == -*f* ]] && xspec=
-	elif [ "$prev" = '>' -o "$prev" = '>>' ]; then
-		xspec=
-	elif [ "$prev" = '<' ]; then
-		xspec=
-	fi
-
-	_expand || return 0
-
-	COMPREPLY=( $( compgen -f -X "$xspec" -- $cur ) \
-		    $( compgen -d -- $cur ) )
-} &&
-complete -F _gzip $filenames gzip
-
 # bzip2(1) completion
 #
 have bzip2 &&
diff --git a/contrib/gzip b/contrib/gzip
new file mode 100644
index 0000000..6d3b1a1
--- /dev/null
+++ b/contrib/gzip
@@ -0,0 +1,44 @@
+# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
+# ex: ts=8 sw=8 noet filetype=sh
+#
+# bash completion for gzip
+
+have gzip &&
+_gzip()
+{
+	local cur prev xspec helpopts
+
+	COMPREPLY=()
+	cur=`_get_cword`
+	prev=${COMP_WORDS[COMP_CWORD-1]}
+	helpopts=`_parse_help gzip`
+
+	if [[ "$cur" == -* ]]; then
+		COMPREPLY=( $( compgen -W "$helpopts -2 -3 -4 -5 -6 -7 -8" \
+						-- "$cur" ) )
+		return 0
+	fi
+
+	local IFS=$'\t\n'
+
+	xspec="*.?(t)gz"
+	if [[ "$prev" == --* ]]; then
+		[[ "$prev" == --decompress || \
+			"$prev" == --list || \
+			"$prev" == --test ]] && xspec="!"$xspec
+		[[ "$prev" == --force ]] && xspec=
+	elif [[ "$prev" == -* ]]; then
+		[[ "$prev" == -*[dlt]* ]] && xspec="!"$xspec
+		[[ "$prev" == -*f* ]] && xspec=
+	elif [ "$prev" = '>' -o "$prev" = '>>' ]; then
+		xspec=
+	elif [ "$prev" = '<' ]; then
+		xspec=
+	fi
+
+	_expand || return 0
+
+	COMPREPLY=( $( compgen -f -X "$xspec" -- $cur ) \
+		    $( compgen -d -- $cur ) )
+} &&
+complete -F _gzip $filenames gzip

-- 
bash-completion



More information about the Bash-completion-commits mailing list