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

Ville Skyttä ville.skytta at iki.fi
Wed Apr 15 12:37:34 UTC 2009


The following commit has been merged in the master branch:
commit 10f2c7bea5dc67531d832965c8b575023c046267
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Wed Apr 15 11:32:49 2009 +0300

    Use _split_longopt in _make.

diff --git a/CHANGES b/CHANGES
index ad02cb1..215e646 100644
--- a/CHANGES
+++ b/CHANGES
@@ -35,7 +35,7 @@ bash-completion (1.x)
   * Add _split_longopt() helper for improved handling of long options that
     take arguments in both "--foo bar" and "--foo=bar" formats.
   * Use _split_longopt to improve and clean up aspell, chgrp, chown, chkconfig,
-    and generic long option completion.
+    make, and generic long option completion.
   * Add chown --from and --reference value completions.
   * Add chgrp --reference value completion.
   * Do not assume all --foo= options take filenames in generic long option
diff --git a/bash_completion b/bash_completion
index d89e2c6..99b88e0 100644
--- a/bash_completion
+++ b/bash_completion
@@ -2966,52 +2966,39 @@ _route()
 have make || have gmake || have gnumake || have pmake &&
 _make()
 {
-	local file makef makef_dir="." makef_inc cur prev i
+	local file makef makef_dir="." makef_inc cur prev i split=false
 
 	COMPREPLY=()
 	cur=`_get_cword`
 	prev=${COMP_WORDS[COMP_CWORD-1]}
 
-	# --name value style option
+	_split_longopt && split=true
+
 	case $prev in
-		-@(f|o|W))
+		-@(f|o|W|-?(make)file))
 			_filedir
 			return 0
 			;;
-		-@(I|C))
+		-I|-C|--directory|--include-dir)
 			_filedir -d
 			return 0
 			;;
 	esac
 
-	# --name=value style option
-	if [[ "$cur" == *=* ]]; then
-		prev=${cur/=*/}
-		cur=${cur/*=/}
-		case "$prev" in
-			--@(file|makefile))
-				_filedir
-				return 0
-				;;
-			--@(directory|include-dir))
-				_filedir -d
-				return 0
-				;;
-		esac
-	fi
+	$split && return 0
 
 	if [[ "$cur" == -* ]]; then
 		COMPREPLY=( $( compgen -W '-b -m -B -C -d -e -f -h -i -I\
 			-j -l -k -n -o -p -q -r -R - s -S -t -v -w -W \
-			--always-make --directory= --debug \
-			--environment-overrides --file= --makefile= --help \
-			--ignore-errors --include-dir= --jobs --load-average \
+			--always-make --directory --debug \
+			--environment-overrides --file --makefile --help \
+			--ignore-errors --include-dir --jobs --load-average \
 			--max-load --keep-going --just-print --dry-run \
-			--recon --old-file= --assume-old= --print-data-base \
+			--recon --old-file --assume-old --print-data-base \
 			--question --no-builtin-rules --no-builtin-variables \
 			--silent --quiet --no-keep-goind --stop --touch \
 			--version --print-directory --no-print-directory \
-			--what-if= --new-file= --assume-new= \
+			--what-if --new-file --assume-new \
 			--warn-undefined-variables' -- $cur ) )
 	else
 		# before we check for makefiles, see if a path was specified

-- 
bash-completion



More information about the Bash-completion-commits mailing list