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

Ville Skyttä ville.skytta at iki.fi
Sat Apr 18 10:57:46 UTC 2009


The following commit has been merged in the master branch:
commit 9bac0313da780aa72ed821f63cda28adaf98ef82
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sat Apr 18 13:57:36 2009 +0300

    Use compgen -W instead of grepping $cur.

diff --git a/contrib/cowsay b/contrib/cowsay
index d9f8bc4..31682c6 100644
--- a/contrib/cowsay
+++ b/contrib/cowsay
@@ -14,7 +14,8 @@ _cowsay()
 
 	case $prev in
 		-f)
-			COMPREPLY=( $( cowsay -l | tail -n +2 | tr " " "\n" | grep "^$cur" ) )
+			COMPREPLY=( $( compgen -W '$( cowsay -l | tail -n +2 \
+				)' -- $cur ) )
 			return 0
 			;;
 	esac

-- 
bash-completion



More information about the Bash-completion-commits mailing list