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

Ville Skyttä ville.skytta at iki.fi
Tue Apr 14 20:48:23 UTC 2009


The following commit has been merged in the master branch:
commit 98839013dbfb3ab482bb6b6cbb9c842f174d40c8
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Tue Apr 14 23:43:39 2009 +0300

    Use _split_longopt in chown, chgrp.

diff --git a/CHANGES b/CHANGES
index bfc9c4e..7c70d15 100644
--- a/CHANGES
+++ b/CHANGES
@@ -34,7 +34,7 @@ bash-completion (1.x)
     input in external command arguments.
   * 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 completion.
+  * Use _split_longopt to improve and clean up aspell, chgrp, chown completion.
 
   [ Todd Zullinger ]
   * Make yum complete on filenames after install, deplist, update and upgrade
diff --git a/bash_completion b/bash_completion
index 7e02cd0..aa4b550 100644
--- a/bash_completion
+++ b/bash_completion
@@ -791,14 +791,19 @@ complete -F _service service
 #
 _chown()
 {
-	local cur
+	local cur prev split=false
 	cur=`_get_cword`
+	prev=${COMP_WORDS[COMP_CWORD-1]}
+
+	_split_longopt && split=true
+
+	$split && return 0
 
 	# options completion
 	if [[ "$cur" == -* ]]; then
 		COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes \
-		--dereference --no-dereference --from= --silent --quiet \
-		--reference= --recursive --verbose --help --version' -- $cur ) )
+		--dereference --no-dereference --from --silent --quiet \
+		--reference --recursive --verbose --help --version' -- $cur ) )
 	else
 		_count_args
 
@@ -818,18 +823,22 @@ complete -F _chown $filenames chown
 #
 _chgrp()
 {
-	local cur prev
+	local cur prev split=false
 
 	COMPREPLY=()
 	cur=`_get_cword`
 	cur=${cur//\\\\/}
 	prev=${COMP_WORDS[COMP_CWORD-1]}
 
+	_split_longopt && split=true
+
+	$split && return 0
+		
 	# options completion
 	if [[ "$cur" == -* ]]; then
 		COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes \
 		--dereference --no-dereference --silent --quiet \
-		--reference= --recursive --verbose --help --version' -- $cur ) )
+		--reference --recursive --verbose --help --version' -- $cur ) )
 		return 0
 	fi
 

-- 
bash-completion



More information about the Bash-completion-commits mailing list