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

Guillaume Rousse guillomovitch at zarb.org
Mon Jun 8 14:51:27 UTC 2009


The following commit has been merged in the master branch:
commit 7522b94f33ab0a6d042d7a6fe3ea5b9269ced2a8
Author: Guillaume Rousse <guillomovitch at zarb.org>
Date:   Mon Jun 8 16:51:48 2009 +0200

    split configure completion

diff --git a/Makefile.am b/Makefile.am
index ee5e2fc..168cb38 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,6 +22,7 @@ bashcomp_DATA = contrib/ant \
 		contrib/cfengine \
 		contrib/cksfv \
 		contrib/clisp \
+		contrib/configure \
 		contrib/cowsay \
 		contrib/cpan2dist \
 		contrib/cpio \
diff --git a/bash_completion b/bash_completion
index 60a94e5..d8db11f 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1407,25 +1407,6 @@ for i in env netstat seq uname units wget; do
 done
 unset i
 
-_configure_func()
-{
-	local cur
-
-	COMPREPLY=()
-	cur=`_get_cword`
-
-	# if $COMP_CONFIGURE_HINTS is not null, then completions of the form
-	# --option=SETTING will include 'SETTING' as a contextual hint
-	[[ "$cur" != -* ]] && return 0
-
-	if [ -n "$COMP_CONFIGURE_HINTS" ]; then
-		COMPREPLY=( $( $1 --help 2>&1 | awk '/^  --[A-Za-z]/ { print $1; if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,].*//g' | grep ^$cur ) )
-	else
-		COMPREPLY=( $( $1 --help 2>&1 | awk '/^  --[A-Za-z]/ { print $1; if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,=].*//g' | grep ^$cur ) )
-	fi
-}
-complete -F _configure_func $default configure
-
 [ $UNAME = FreeBSD ] && {
 # FreeBSD package management tool completion
 #
diff --git a/contrib/configure b/contrib/configure
new file mode 100644
index 0000000..c98603b
--- /dev/null
+++ b/contrib/configure
@@ -0,0 +1,23 @@
+# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
+# ex: ts=8 sw=8 noet filetype=sh
+#
+# bash completion for configure
+
+_configure()
+{
+	local cur
+
+	COMPREPLY=()
+	cur=`_get_cword`
+
+	# if $COMP_CONFIGURE_HINTS is not null, then completions of the form
+	# --option=SETTING will include 'SETTING' as a contextual hint
+	[[ "$cur" != -* ]] && return 0
+
+	if [ -n "$COMP_CONFIGURE_HINTS" ]; then
+		COMPREPLY=( $( $1 --help 2>&1 | awk '/^  --[A-Za-z]/ { print $1; if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,].*//g' | grep ^$cur ) )
+	else
+		COMPREPLY=( $( $1 --help 2>&1 | awk '/^  --[A-Za-z]/ { print $1; if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,=].*//g' | grep ^$cur ) )
+	fi
+}
+complete -F _configure $default configure

-- 
bash-completion



More information about the Bash-completion-commits mailing list